{"uid":"cap_yQzbhpEXgdtfcF80d1Hsg","slug":"preflight-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-add82a1c","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/malformed-json-healer)","url":"https://preflight.agentdiet.dev/v1/malformed-json-healer?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_WBq1blZgWsGlmVf-quJO9","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":"My LLM just returned this broken JSON with trailing commas and markdown code fences and I need it fixed so my pipeline can parse it — can you repair it: ```{\"name\": \"Alice\", \"score\": 42,}```?","exampleUseCases":[{"title":"Fix LLM pipeline JSON crash","prompt":"My AI agent returned malformed JSON with trailing commas and now my downstream parser is crashing — can you repair this string for me: {\"status\": \"ok\", \"data\": [1, 2, 3,]}?"},{"title":"Strip markdown fences from JSON","prompt":"The LLM wrapped its JSON output in triple backticks and my code can't parse it — please clean up this response and give me valid JSON: ```json\n{\"result\": \"success\", \"count\": 5}\n```"},{"title":"Fix single-quoted JSON from agent","prompt":"I got back a JSON blob from my agent that uses single quotes instead of double quotes and it's breaking my schema validator — fix this for me: {'user': 'bob', 'active': true}"}],"resultDescription":"Returns a repaired, standards-compliant JSON object derived from the input malformed string, with issues like trailing commas, markdown fences, single quotes, and truncations corrected so it can be safely parsed by downstream systems.","failureModes":["Input JSON too severely corrupted to deterministically repair — returns error or best-effort partial result","Input string is not JSON at all — may return validation error","Ambiguous truncation with no recoverable structure — may return null or error response","Network or payment authorization failure (HTTP 402 if micropayment not processed)"],"whenToPreferThis":"Choose this endpoint when your multi-agent pipeline receives LLM-generated JSON that fails standard JSON.parse() due to common LLM formatting errors like trailing commas, markdown code fences, single quotes, or truncation. Prefer it over manual regex heuristics or custom parsers when you need a reliable, deterministic fix that won't introduce data loss or hallucinated fields.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:23:17.020Z","isFirstParty":false,"canonicalSlug":"preflight-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-1d25665d"}