{"uid":"cap_HvZGiJQsQq3V476Uw-ByR","slug":"preflight-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-0bd9bcdd","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://preflight.agentdiet.dev/v1/schema-repair)","url":"https://preflight.agentdiet.dev/v1/schema-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_p206TiLuJuP9BX52q_30R","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"preflight.agentdiet.dev","brandSlug":"preflight-agentdiet-dev-mpp","brandBaseUrl":"https://preflight.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Repairs truncated or malformed LLM JSON outputs (trailing commas, markdown fences, single quotes) so multi-agent pipelines can process the result without crashing.","exampleAgentPrompt":"The JSON output I got from the LLM is broken — it has trailing commas and markdown code fences around it. Can you repair it so it's valid JSON I can actually use? Here it is: ```json {\"name\": \"Alice\", \"age\": 30,}```","exampleUseCases":[{"title":"Fix LLM output before pipeline step","prompt":"The language model returned this JSON with trailing commas and it's breaking my next pipeline step — can you repair it? Here's the raw output: {\"status\": \"ok\", \"items\": [\"a\", \"b\",],}"},{"title":"Strip markdown fences from agent response","prompt":"My coding agent wrapped its JSON response in markdown backticks and now I can't parse it. Can you clean this up and give me valid JSON? The raw string is: ```json\n{\"result\": true, \"score\": 0.95}\n```"},{"title":"Recover truncated JSON from streaming model","prompt":"The streaming response from the model got cut off mid-way and I ended up with incomplete JSON. Can you repair this truncated string so I can extract the data? Here it is: {\"user\": \"bob\", \"items\": [1, 2, 3"}],"resultDescription":"A repaired, syntactically valid JSON object corrected from the malformed input — with trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncated structures closed — ready for downstream parsing and processing.","failureModes":["Input is so severely malformed that deterministic repair is impossible — returns error response","Input is empty or below minimum length — returns 400 validation error","JSON structure is ambiguous after truncation and cannot be reliably inferred — repair may be incomplete","Network or service timeout — agent should retry with Idempotency-Key header to avoid duplicate processing"],"whenToPreferThis":"Choose this endpoint when LLM-generated JSON needs to be reliably fixed before downstream agent steps consume it — especially when you need deterministic, rule-based repair rather than another LLM inference pass. Ideal for multi-agent pipelines where JSON parsing errors would cascade into failures, or when you need consistent repair behavior without nondeterminism.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-21T06:44:04.247Z","isFirstParty":false,"canonicalSlug":"preflight-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-1d25665d"}