{"uid":"cap_CHWLEpTk4HmNcKwaDk9ML","slug":"preflight-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-b1e9be1a","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/json-repair)","url":"https://preflight.agentdiet.dev/v1/json-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_oU_zr8JoL3GCrgTrSnwVL","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 never crash","exampleAgentPrompt":"This LLM response came back with broken JSON — trailing commas, markdown fences, the works — can you repair it so it parses cleanly? Here's the raw output: ```{\"name\": \"Alice\", \"score\": 42,}```","exampleUseCases":[{"title":"Fix LLM JSON before pipeline ingestion","prompt":"My AI model just returned this malformed JSON with a trailing comma and I need it fixed before my data pipeline processes it: {\"user\": \"bob\", \"status\": \"active\",} — can you repair it?"},{"title":"Strip markdown fences from agent output","prompt":"The coding agent returned JSON wrapped in triple backticks and it's breaking my parser — please clean up this raw output and give me valid JSON: ```json\n{\"result\": \"ok\", \"count\": 5}\n```"},{"title":"Rescue truncated JSON from a crashed LLM call","prompt":"My LLM call timed out halfway through generating JSON and I got this truncated mess: {\"items\": [{\"id\": 1, \"name\": \"widget\"} — can you repair it into valid JSON so I don't lose the partial data?"}],"resultDescription":"A repaired, valid JSON object derived from the malformed input — with trailing commas removed, markdown fences stripped, single quotes normalized to double quotes, and truncated structures closed — ready for downstream parsing without errors.","failureModes":["Input JSON is too severely malformed to deterministically repair (ambiguous structure)","Input string is not JSON at all (returns error or best-effort empty object)","Truncated JSON missing critical structural context cannot be reliably closed","Payment failure via x402 returns 402 status before processing","Excessively long raw_json strings may hit query parameter length limits"],"whenToPreferThis":"Choose this endpoint when your multi-agent pipeline or LLM output produces JSON that fails to parse due to common LLM formatting mistakes — trailing commas, markdown code fences, single-quote delimiters, or truncation. It is deterministic (not probabilistic), making it reliable for production pipelines where consistency matters. Prefer it over ad-hoc string manipulation or prompting the LLM to retry, as it is purpose-built for A2A and MCP workflows and avoids wasting tokens on a retry round-trip.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:23:37.628Z","isFirstParty":false,"canonicalSlug":"preflight-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-1d25665d"}