{"uid":"cap_1z7M52xDm9TejgFdFWAsR","slug":"arxiv-digest-agentdiet-dev-deterministic-a2a-broken-json-repair-b47cafde","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/llm-json-schema-healer)","url":"https://arxiv-digest.agentdiet.dev/v1/llm-json-schema-healer?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_SQlVgpEnSpvUX2vsOEdjs","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 from our LLM pipeline is malformed — it has trailing commas and markdown code fences wrapping it — can you repair it so it's valid JSON I can parse? Here's the raw output: ```json {\"name\": \"Alice\", \"score\": 42, } ```","exampleUseCases":[{"title":"Fixing LLM output before downstream agent","prompt":"The JSON our summarization agent just returned has a trailing comma and is wrapped in markdown backticks — can you repair it so the next agent in our pipeline can parse it without crashing? Here's the raw string: ```json {\"summary\": \"results were good\", \"count\": 5, } ```"},{"title":"Recovering truncated JSON from long generation","prompt":"Our LLM got cut off mid-response and the JSON it produced is truncated and broken — can you repair it and give me a valid JSON object back? The raw output is: {\"items\": [{\"id\": 1, \"title\": \"First"},{"title":"Normalizing single-quoted JSON from agent output","prompt":"One of our agents returned JSON using single quotes instead of double quotes and it's failing to parse — can you fix it into valid standard JSON? The raw string is: {'user': 'bob', 'active': true, 'score': 99}"}],"resultDescription":"A valid, repaired JSON object with all syntax errors corrected — trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncated structures closed — ready for downstream parsing without crashing.","failureModes":["JSON so severely corrupted it cannot be deterministically repaired — returns error indicating repair was not possible","Input that is not recognizable as JSON-like at all — may return parsing failure","Ambiguous truncation where multiple valid completions exist — repair may not match original intent","Empty or whitespace-only input — returns validation error"],"whenToPreferThis":"Choose this endpoint when you have LLM-generated JSON that is syntactically broken due to common issues like trailing commas, markdown code fences, single quotes, or truncation, and you need a deterministic (not generative/AI-based) repair that guarantees a valid parseable output. Especially valuable in multi-agent pipelines where a crashed JSON parse would halt the entire workflow. Prefer this over writing custom regex fixes or using an LLM to re-generate the JSON when you need fast, cheap, reliable, and idempotent correction.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-18T01:17:17.155Z","isFirstParty":false,"canonicalSlug":"arxiv-digest-agentdiet-dev-deterministic-a2a-broken-json-repair-859b9028"}