{"uid":"cap_yhoxTY80mbB2IDSi9H9kl","slug":"preflight-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-5aa3b29e","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/llm-json-schema-healer)","url":"https://preflight.agentdiet.dev/v1/llm-json-schema-healer?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_9f-HPOQzPYWk1TT_4K_QF","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, malformed, or markdown-wrapped JSON from LLM outputs so multi-agent pipelines never crash on bad JSON.","exampleAgentPrompt":"This LLM output came back as broken JSON with trailing commas and markdown fences — can you fix it so my pipeline can parse it? Here's the raw string: ```{\"name\": \"Alice\", \"age\": 30,}```","exampleUseCases":[{"title":"Fixing LLM pipeline JSON crashes","prompt":"My agent just returned this malformed JSON with a trailing comma and single quotes and my pipeline crashed — can you repair it so it's valid? Here's the string: {'name': 'Bob', 'score': 42,}"},{"title":"Stripping markdown fences from agent output","prompt":"The language model wrapped its JSON response in triple backtick markdown fences and now I can't parse it. Can you clean this up and give me valid JSON: ```json\n{\"status\": \"ok\", \"result\": [1, 2, 3]}\n```"},{"title":"Recovering truncated JSON from an LLM","prompt":"My LLM got cut off mid-response and returned incomplete JSON like {\"items\": [{\"id\": 1, \"name\": \"widget\" — can you repair and close it so I get a valid parseable object?"}],"resultDescription":"A JSON object containing the repaired, valid JSON output. The malformed input string is deterministically fixed — trailing commas removed, markdown fences stripped, single quotes normalized to double quotes, truncated structures closed — and returned as parseable, schema-valid JSON ready for downstream agent consumption.","failureModes":["Input JSON is too severely corrupted to deterministically repair — returns an error indicating repair was not possible","Input string is empty or whitespace — rejected with minLength validation error","Ambiguous structure where multiple valid repairs exist — may return best-guess repair or error","Payment not provided or insufficient — returns HTTP 402 requiring x402 USDC payment","Network timeout or service unavailability — returns 5xx error"],"whenToPreferThis":"Choose this endpoint when your multi-agent or LLM pipeline is receiving malformed JSON outputs — especially those with trailing commas, markdown code fences, single quotes, or truncation — and you need a deterministic, rule-based repair rather than asking another LLM to guess at the fix. It is ideal for production pipelines where reliability and consistency matter more than probabilistic correction, and for cases where you need cheap, fast, non-AI JSON healing at $0.002 per call.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-21T06:43:50.723Z","isFirstParty":false,"canonicalSlug":"preflight-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-1d25665d"}