{"uid":"cap_AeMwYwYt3fsVLDgHWsKB8","slug":"arxiv-digest-agentdiet-dev-deterministic-a2a-broken-json-repair-3620e1ea","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/malformed-json-healer)","url":"https://arxiv-digest.agentdiet.dev/v1/malformed-json-healer?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_RAQpzR-fCte5hQlReWDaW","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 out of my LLM and it's broken — it has trailing commas, markdown fences, and single quotes instead of double quotes. Can you fix it so it parses correctly? Here's the raw output: ```json {name: 'Alice', age: 30, hobbies: ['reading', 'coding',]} ```","exampleUseCases":[{"title":"Fixing LLM pipeline JSON crashes","prompt":"My agent pipeline keeps crashing because the upstream LLM keeps returning malformed JSON with trailing commas and markdown code fences. Can you repair this broken output so it parses cleanly: ```json {\"items\": [\"apple\", \"banana\",], \"count\": 2,} ```"},{"title":"Sanitizing single-quoted JSON from model","prompt":"The AI model I'm using returns JSON with single quotes instead of double quotes and it breaks my downstream parser. Fix this for me: {name: 'John Doe', role: 'admin', active: true}"},{"title":"Recovering truncated JSON response","prompt":"My LLM got cut off mid-response and returned incomplete JSON. Can you repair this truncated string so it's valid JSON again: {\"users\": [{\"id\": 1, \"name\": \"Alice\"}, {\"id\": 2, \"name\": \"Bob\""}],"resultDescription":"Returns a repaired JSON object where the previously malformed, truncated, or markdown-wrapped input has been deterministically fixed — with trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and any truncated structures closed — resulting in a valid, parseable JSON object.","failureModes":["Input JSON is so severely corrupted that deterministic repair is impossible, returning an error","Input is not JSON-like at all (plain text, binary data), causing a validation rejection","Ambiguous truncation with multiple valid completion candidates may produce unexpected structure","Empty or whitespace-only raw_json input returns a validation error","Network timeout or service unavailability returns HTTP 402/503"],"whenToPreferThis":"Choose this endpoint when your multi-agent or LLM pipeline is receiving malformed JSON that needs deterministic (not probabilistic) repair — especially for trailing commas, markdown fences, and single-quote issues common in LLM outputs. Prefer this over writing custom regex fixers or relying on LLM self-correction when you need consistent, repeatable JSON healing at low cost per call.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T12:51:21.691Z","isFirstParty":false,"canonicalSlug":"arxiv-digest-agentdiet-dev-deterministic-a2a-broken-json-repair-859b9028"}