{"uid":"cap_fxsq93rBOEKIvFU7H13nQ","slug":"arxiv-digest-agentdiet-dev-deterministic-a2a-broken-json-repair-f0bddb9e","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://arxiv-digest.agentdiet.dev/v1/json-repair)","url":"https://arxiv-digest.agentdiet.dev/v1/json-repair?utm_source=zero.xyz","method":"POST","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_FUgtgXwJAJfBDK2feGySE","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"arxiv-digest.agentdiet.dev","brandSlug":"arxiv-digest-agentdiet-dev-mpp","brandBaseUrl":"https://arxiv-digest.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Repairs truncated or malformed LLM JSON outputs (trailing commas, markdown fences, single quotes) so multi-agent pipelines never crash","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 properly: ```json {\"name\": \"Alice\", \"age\": 30, } ```","exampleUseCases":[{"title":"Fix LLM output in agent pipeline","prompt":"My AI pipeline just got a malformed JSON response from GPT — it has trailing commas and is wrapped in markdown fences. Can you repair this so the next step doesn't crash: ```json {\"status\": \"ok\", \"results\": [1, 2, 3,], } ```"},{"title":"Repair truncated JSON from streaming","prompt":"This JSON got cut off mid-stream and won't parse: '{\"user\": {\"id\": 42, \"name\": \"Bob\", \"roles\": [\"admin\"' — can you fix it into valid JSON?"},{"title":"Normalize single-quote JSON from scraper","prompt":"I scraped some data and got back JSON using single quotes instead of double quotes, like {'product': 'widget', 'price': 9.99} — please repair it into valid JSON I can actually use."}],"resultDescription":"A JSON object containing the repaired, valid JSON parsed from the malformed input, suitable for direct downstream consumption in agent workflows without further sanitization.","failureModes":["Input is so severely corrupted that deterministic repair is impossible — returns error indicating unrecoverable JSON","Empty or whitespace-only raw_json input rejected with validation error","Input that is not JSON-like at all (e.g. plain prose) may fail or return unexpected structure","Network timeout or payment failure on x402 returns 402 or 5xx with no repaired output"],"whenToPreferThis":"Choose this endpoint when your multi-agent pipeline receives LLM-generated JSON that fails to parse due to common issues like trailing commas, markdown code fences, single quotes, or truncation. Prefer this over manual regex fixes or custom parsers when you need a deterministic, hosted solution that handles a broad range of malformation patterns without maintaining your own repair logic. Especially valuable in streaming LLM scenarios where truncation is common.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-21T06:38:54.090Z","isFirstParty":false,"canonicalSlug":"arxiv-digest-agentdiet-dev-deterministic-a2a-broken-json-repair-859b9028"}