{"uid":"cap_0BLcN-o6K71AbbLWUDpFE","slug":"preflight-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-c2871b4a","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":"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_yPhTcdyRsBnRdc6u4y_ee","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":"Deterministically repairs malformed, truncated, or markdown-wrapped JSON strings from LLM outputs so multi-agent pipelines can safely parse and continue processing.","exampleAgentPrompt":"This JSON from my LLM came back malformed — it has trailing commas, single quotes, and a markdown code fence around it. Can you repair it so it parses correctly: ```{'name': 'Alice', 'age': 30,}```?","exampleUseCases":[{"title":"Fix LLM output before downstream agent","prompt":"My language model returned JSON with trailing commas and single quotes that's breaking my pipeline — here's the raw string: {'items': ['a', 'b',], 'count': 2,} — can you repair it so it's valid JSON?"},{"title":"Strip markdown fences from model response","prompt":"The model wrapped its JSON response in triple backticks and now my parser is crashing. Can you clean up this output and give me plain valid JSON: ```json\n{\"status\": \"ok\", \"result\": 42\n```?"},{"title":"Recover truncated JSON from long generation","prompt":"My model hit its token limit mid-generation and the JSON got cut off — it ends abruptly without closing brackets. Here's the broken string: {\"users\": [{\"id\": 1, \"name\": \"Bob\" — can you repair and close it out into valid parseable JSON?"}],"resultDescription":"Returns a repaired, valid JSON object derived from the malformed input string, with syntax errors like trailing commas, single quotes, markdown fences, and truncated structures corrected so the output is immediately parseable.","failureModes":["Input is so severely truncated or corrupted that no deterministic repair is possible","Input is not JSON at all (e.g. plain prose), resulting in an error or empty object","Ambiguous structure where multiple valid repairs exist and the heuristic picks the wrong one","Payment authorization fails (x402), blocking the request","Query string encoding issues when passing complex JSON as a GET parameter"],"whenToPreferThis":"Choose this endpoint when an LLM or agent in your pipeline is producing JSON with common syntax errors (trailing commas, markdown fences, single quotes, truncation) and you need a deterministic, non-LLM fix that won't introduce hallucinated fields. Prefer it over asking another LLM to re-generate or fix the JSON, since this is cheaper, faster, and reproducible.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:25:58.412Z","isFirstParty":false,"canonicalSlug":"preflight-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-1d25665d"}