{"uid":"cap_WbNkZ5xHObcpoKSCo37tH","slug":"agentstoolshub-json-repair-846bfd02","name":"AgentsToolsHub JSON Repair","description":"Repairs broken JSON: trailing commas, single quotes, unquoted keys, Python literals (True/False/None), NaN, comments, smart quotes and truncated documents. Built for the most common agentic failure mode — parsing slightly-wrong JSON from an LLM or a human. Use this when an agent needs to fix LLM-mangled, truncated or sloppy JSON.","url":"https://agentstoolshub.com/api/v1/dev/json-repair?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["text"],"properties":{"text":{"type":"string","description":"Broken JSON"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_MDhEFWNpdmwJIvNIIWU4V","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Repairs broken or malformed JSON by fixing trailing commas, single quotes, unquoted keys, Python literals, NaN, comments, smart quotes, and truncated documents","exampleAgentPrompt":"This JSON from the LLM response has trailing commas and single quotes and won't parse — can you fix it? Here it is: {'name': 'Alice', 'age': 30, 'active': True,}","exampleUseCases":[{"title":"Fix LLM-generated malformed JSON","prompt":"The model returned this JSON but it has single quotes and a trailing comma and my parser is choking on it — can you repair it so it's valid? {'user': 'bob', 'score': 42, 'verified': True,}"},{"title":"Recover truncated API response JSON","prompt":"I got a JSON response that got cut off mid-document and now it won't parse. Can you fix this truncated JSON and return a valid version? {\"items\": [{\"id\": 1, \"name\": \"widget\"}, {\"id\": 2"},{"title":"Normalize Python dict to valid JSON","prompt":"I have a Python dictionary literal with True, False, None and NaN values that I need converted to valid JSON so I can pass it to another service. Here it is: {'enabled': True, 'count': None, 'ratio': NaN}"}],"resultDescription":"A valid, parseable JSON object with all syntax errors corrected — trailing commas removed, single quotes replaced with double quotes, unquoted keys quoted, Python literals (True/False/None) converted to JSON equivalents, NaN handled, comments stripped, smart quotes normalized, and truncated documents completed or closed as best as possible.","failureModes":["Input is so severely malformed it cannot be meaningfully repaired — returns an error or empty result","Input is not JSON-like at all (e.g. plain text or binary) — repair may fail or return unexpected output","Truncated JSON with ambiguous structure may be completed in an unintended way","Missing required 'text' query parameter returns a validation error"],"whenToPreferThis":"Use this endpoint whenever an LLM, human, or upstream service produces JSON that fails standard parsing due to common syntax mistakes. It specifically handles the most frequent agentic failure modes — LLM outputs with Python-style literals, trailing commas, single quotes, and truncated responses — making it the right choice before retrying a JSON.parse() call or before passing LLM output to a downstream system.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-17T12:40:27.133Z","isFirstParty":false,"canonicalSlug":"agentstoolshub-json-repair-846bfd02"}