{"uid":"cap_QFTfHJMCO-1RetBL9JH2V","slug":"arxiv-digest-agentdiet-dev-deterministic-a2a-broken-json-repair-1ef8d5ec","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-fix)","url":"https://arxiv-digest.agentdiet.dev/v1/json-fix?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_t06Rj9pRly2UOIlRHnXPb","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 JSON string came back from the LLM and won't parse — it has trailing commas and markdown code fences around it. Can you fix it so I can use it? Here it is: ```json {\"name\": \"Alice\", \"score\": 42, } ```","exampleUseCases":[{"title":"Multi-agent pipeline JSON recovery","prompt":"The previous agent returned this broken JSON with a trailing comma and I can't pass it to the next step: {\"items\": [\"a\", \"b\",], \"count\": 2,}. Can you repair it so my pipeline doesn't crash?"},{"title":"LLM markdown fence stripping","prompt":"My LLM wrapped its JSON response in markdown backticks and now my parser is throwing errors. Here's the raw output: ```json\n{\"status\": 'ok', \"value\": 100}\n``` — can you strip the fences and fix the single quotes so it's valid JSON?"},{"title":"Truncated JSON response repair","prompt":"I got a cut-off JSON response that ends mid-string: {\"user\": \"bob\", \"message\": \"hello wor — can you repair and complete it into valid parseable JSON so I can continue processing?"}],"resultDescription":"A repaired, valid JSON object that has been cleaned of common LLM output artifacts such as trailing commas, markdown fences, single quotes, and truncation issues — ready for downstream parsing and consumption by the next agent or service in the pipeline","failureModes":["Input JSON is too severely malformed to deterministically repair — returns error with explanation","Input string is empty or below minimum length — validation error","JSON structure is ambiguous after repair — may return best-effort result with warning","Payment/402 authentication failure — request blocked","Rate limiting or quota exceeded — 429 response"],"whenToPreferThis":"Choose this endpoint when your multi-agent pipeline or LLM workflow produces JSON that fails to parse due to common LLM artifacts like trailing commas, markdown code fences, single quotes instead of double quotes, or truncation. It is deterministic (not probabilistic), making it reliable and predictable for automated pipelines. Prefer this over manual string manipulation or probabilistic LLM re-prompting when you need fast, consistent JSON repair without burning additional LLM tokens.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-28T00:37:18.578Z","isFirstParty":false,"canonicalSlug":"arxiv-digest-agentdiet-dev-deterministic-a2a-broken-json-repair-859b9028"}