{"uid":"cap_am2BowjP2RxOAzy3LkXHo","slug":"arxiv-digest-agentdiet-dev-deterministic-a2a-broken-json-repair-4196aa76","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":"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_Yg601_9lZJB3EOWij3tRi","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, markdown fences) so multi-agent pipelines can safely parse LLM outputs.","exampleAgentPrompt":"The LLM just returned this broken JSON with trailing commas and markdown fences — can you repair it so I can parse it? Here it is: ```json {\"name\": \"Alice\", \"age\": 30, } ```","exampleUseCases":[{"title":"Fix LLM output before agent handoff","prompt":"My language model returned a JSON block with trailing commas and it's wrapped in markdown fences — can you clean it up so the next agent in my pipeline can parse it without crashing?"},{"title":"Repair truncated JSON from streaming response","prompt":"The streaming API cut off mid-response and I got this incomplete JSON: {\"results\": [{\"id\": 1, \"value\": \"foo\" — can you repair it and close all the open brackets so I can use it?"},{"title":"Sanitize single-quoted JSON from Python repr","prompt":"I have a Python dict that was serialized with single quotes instead of double quotes and it's failing JSON.parse — can you convert it to valid JSON for me?"}],"resultDescription":"A repaired, syntactically valid JSON object that has had trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncated structures closed — ready for downstream parsing.","failureModes":["Input is so severely malformed it cannot be deterministically repaired — returns an error indicating unrecoverable structure","Input is not JSON-like at all (e.g. plain text or binary) — returns a validation error","Empty or missing raw_json field — returns a 400 bad request","Ambiguous repair paths where multiple valid completions exist may produce unexpected but syntactically valid JSON"],"whenToPreferThis":"Choose this endpoint when you need deterministic, rule-based JSON repair of LLM outputs — especially when you need consistent, reproducible results across retries (supports idempotency keys). Prefer this over ad-hoc string manipulation or prompting the LLM again when pipeline reliability and cost efficiency matter, as it costs $0.002 per call and avoids expensive LLM re-inference.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-21T12:38:53.286Z","isFirstParty":false,"canonicalSlug":"arxiv-digest-agentdiet-dev-deterministic-a2a-broken-json-repair-859b9028"}