{"uid":"cap_msur1v-q0SjibQQb1ihQ2","slug":"arxiv-digest-agentdiet-dev-deterministic-a2a-broken-json-repair-859b9028","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/repair)","url":"https://arxiv-digest.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_tPTktQM0D0jgrwWoDtBcm","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 malformed, truncated, or markdown-wrapped JSON strings (trailing commas, single quotes, fences) so multi-agent pipelines receive valid JSON without crashing.","exampleAgentPrompt":"The LLM just returned this broken JSON with trailing commas and markdown code fences — can you run it through the JSON repair service to get a clean, parseable object? Here's the raw string: ```{\"name\": \"Alice\", \"age\": 30,}```","exampleUseCases":[{"title":"Fix LLM output in agent pipeline","prompt":"My agent just got back a response from GPT that has trailing commas and single quotes and it's crashing my pipeline — can you repair this JSON so I can parse it: {'status': 'ok', 'items': ['a', 'b',]}"},{"title":"Strip markdown fences from JSON response","prompt":"This LLM output came wrapped in triple backticks and has a json tag at the top — can you clean it up and give me the raw valid JSON? Here's what I got: ```json\n{\"result\": \"success\", \"count\": 5}\n```"},{"title":"Recover truncated JSON from long generation","prompt":"The model got cut off mid-response and my JSON is truncated — it ends with just an open bracket and no closing. Can you try to repair and close this JSON string so it's valid: {\"data\": [{\"id\": 1, \"name\": \"foo\""}],"resultDescription":"A repaired, valid JSON object that has been cleaned of common LLM-induced malformations such as trailing commas, markdown code fences, single quotes used in place of double quotes, and truncation artifacts. The response is a JSON object (schema unspecified beyond type:object) containing the corrected structure ready for downstream parsing.","failureModes":["Input JSON is so severely malformed or truncated that deterministic repair is impossible — returns error or best-effort partial result","Input string is not JSON at all (e.g. plain prose) — may return an error or unexpected output","Very large JSON strings may hit query parameter length limits since raw_json is passed as a GET query param","Network timeout or service unavailability returns HTTP error","Payment failure via x402 protocol prevents the call from completing"],"whenToPreferThis":"Choose this endpoint when you need deterministic, rule-based JSON repair rather than LLM-based rewriting — ideal for multi-agent pipelines where you need consistent, reproducible fixes without risking hallucinated field values. Prefer it over ad-hoc string manipulation or asking the LLM to re-output JSON, especially when handling common LLM formatting artifacts like trailing commas, markdown fences, and single quotes at $0.002 per call.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:20:08.912Z","isFirstParty":false,"canonicalSlug":"arxiv-digest-agentdiet-dev-deterministic-a2a-broken-json-repair-859b9028"}