{"uid":"cap_Y7QNePHxHVwZQfisuuSAR","slug":"json-repair-46ed866b","name":"JSON Repair","description":"Conservatively repair common JSON syntax errors (unquoted keys, single-quoted strings, trailing commas) and parse the result; input is never evaluated as code.","url":"https://digitalworkerapi.com/v1/tools/json-repair?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"type":"object"},"type":{"type":"string","const":"http"},"method":{"enum":["POST"],"type":"string"},"bodyType":{"enum":["json"],"type":"string"}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"enum":["json"],"type":"string"},"example":{}},"additionalProperties":false}},"additionalProperties":false},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","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.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_JklHevTI54QbFb4kjiHNc","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Conservatively repairs common JSON syntax errors (unquoted keys, single-quoted strings, trailing commas) and returns a parsed, valid JSON object.","exampleAgentPrompt":"This JSON string is failing to parse because of unquoted keys and trailing commas — can you repair it and give me back a valid, parsed JSON object?","exampleUseCases":[{"title":"Fix LLM-generated malformed JSON","prompt":"The AI output I got has single-quoted strings and trailing commas and won't parse — can you repair it into valid JSON for me?"},{"title":"Clean up user-submitted JSON data","prompt":"A user submitted this JSON form payload but it has unquoted keys and syntax errors. Can you fix it so I can store it properly?"},{"title":"Recover broken API response JSON","prompt":"I got a response from an external API that's almost valid JSON but has trailing commas and a few unquoted keys — can you repair it so I can process it?"}],"resultDescription":"A valid, parsed JSON object produced by conservatively repairing the input's syntax errors (unquoted keys normalized to quoted, single-quoted strings converted to double-quoted, trailing commas removed). The input is never evaluated as code.","failureModes":["Input JSON is too malformed to repair conservatively — returns an error indicating the structure cannot be salvaged","Input body is empty or missing the required fields — returns a validation error","JSON contains ambiguous structures that cannot be safely repaired without changing semantics — may return partial result or error","Non-JSON content types submitted — returns a rejection error"],"whenToPreferThis":"Choose this endpoint when you have JSON with known common syntax errors (unquoted keys, single-quoted strings, trailing commas) that need conservative repair without code evaluation. Ideal for fixing LLM-generated JSON, user-submitted payloads, or degraded API responses where you need a safe, non-evaluating parser. Prefer this over custom regex fixes or eval-based approaches when safety and predictability are priorities.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-30T07:02:59.103Z","isFirstParty":false,"canonicalSlug":"json-repair-46ed866b"}