{"uid":"cap_JrWjW989gvP82X5KZSIhq","slug":"json-repair-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-e921208f","name":"Deterministic A2A Broken-JSON Repair & Schema Validator","description":"Repairs truncated or malformed LLM JSON outputs (trailing commas, markdown fences, single quotes) so multi-agent pipelines never crash. (Live x402 v2, IETF MPP & MCP endpoint at https://json-repair.agentdiet.dev/v1/repair)","url":"https://json-repair.agentdiet.dev/v1/repair?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","required":["raw_json"],"properties":{"raw_json":{"type":"string","minLength":1,"description":"Malformed, truncated, or markdown-wrapped JSON string to deterministically repair"}}},"responseSchema":{"type":"object"},"example":null,"exampleRequest":null,"tags":[],"displayCostAmount":"0.002","displayCostAsset":"USD","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":"mpp","network":"tempo","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"mpp","network":"tempo","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_ZnBafJzKnvUiioxo6OdfL","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"json-repair.agentdiet.dev","brandSlug":"json-repair-agentdiet-dev-mpp","brandBaseUrl":"https://json-repair.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Repairs truncated or malformed JSON strings (trailing commas, markdown fences, single quotes, truncation) so multi-agent pipelines receive valid, parseable JSON","exampleAgentPrompt":"This LLM response came back as broken JSON with trailing commas and markdown code fences — can you repair it so I can parse it? Here's the raw string: ```{\"name\": \"Alice\", \"age\": 30,}```","exampleUseCases":[{"title":"Fix crashed multi-agent pipeline JSON","prompt":"My orchestration agent got a truncated JSON response from the model and now the pipeline is crashing — can you repair this raw string so it's valid JSON I can parse? Here it is: {\"status\": \"ok\", \"items\": [{\"id\": 1, \"val"},{"title":"Clean markdown-wrapped LLM output","prompt":"The LLM wrapped its JSON answer in triple backticks and added trailing commas — can you strip all that and give me clean, valid JSON? Raw text: ```json\\n{\"user\": 'bob', \"score\": 42,}\\n```"},{"title":"Sanitize single-quoted JSON before database insert","prompt":"I got this JSON back from an AI agent but it uses single quotes instead of double quotes and I can't insert it — please fix it to valid JSON: {'product': 'widget', 'price': 9.99, 'available': true}"}],"resultDescription":"A repaired, valid JSON object derived from the input malformed string, with markdown fences stripped, trailing commas removed, single quotes normalized to double quotes, and truncated structures closed — ready for immediate programmatic parsing.","failureModes":["Input so severely malformed that deterministic repair cannot recover a valid structure — returns an error or best-effort partial result","Extremely long JSON strings may hit query parameter length limits when passed via GET","Ambiguous truncation points may result in incorrect inferred structure closing","Empty or whitespace-only raw_json input returns a validation error"],"whenToPreferThis":"Choose this endpoint when your AI agent pipeline receives JSON output from an LLM that fails JSON.parse() due to common LLM formatting errors like trailing commas, markdown code fences, single quotes, or mid-generation truncation. It is purpose-built for deterministic, rule-based repair rather than probabilistic rewriting, making it reliable for production multi-agent pipelines where consistency matters. Prefer this over manually writing repair logic or prompting the LLM to retry, especially when you need low-latency, per-call fixes without burning additional LLM tokens.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:22:48.052Z","isFirstParty":false,"canonicalSlug":"json-repair-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-e921208f"}