{"uid":"cap_gS8OXXoDDRBftcxHRZLPB","slug":"preflight-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-a99cc8ca","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/repair)","url":"https://preflight.agentdiet.dev/v1/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_7oTQJYR0muiR3Afw2hVXc","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 safely parse downstream responses.","exampleAgentPrompt":"This JSON response I got from the LLM is broken — it has trailing commas, single quotes, and markdown fences wrapping it. Can you fix it so I can parse it properly: ```{name: 'Alice', age: 30,}```?","exampleUseCases":[{"title":"Fix malformed LLM pipeline output","prompt":"The JSON my coding assistant just returned has trailing commas and is wrapped in markdown code fences, which is breaking my downstream parser. Can you repair this raw string so it's valid JSON I can actually use?"},{"title":"Sanitize multi-agent relay payload","prompt":"One of the agents in my pipeline sent back a response with single-quoted strings and an unterminated array. I need that cleaned up before passing it to the next agent — can you fix this broken JSON for me?"},{"title":"Rescue truncated API response","prompt":"My LLM hit its token limit mid-response and the JSON got cut off. Can you try to repair and complete this truncated JSON string so it's at least parseable?"}],"resultDescription":"A repaired, schema-compliant JSON object derived from the malformed input. The response contains the fixed JSON ready for downstream parsing, with all syntax errors (trailing commas, markdown fences, single quotes, truncation) resolved deterministically.","failureModes":["Input is so severely malformed that deterministic repair is impossible — returns error indicating unrecoverable structure","Input is not JSON-like at all (e.g. plain prose) — returns validation error","Empty or whitespace-only raw_json input — returns 400-style error","Truncation is too severe to infer closing structure — returns partial repair or failure notice"],"whenToPreferThis":"Choose this endpoint when you need deterministic, rule-based JSON repair rather than LLM-based reformatting — ideal for multi-agent pipelines where consistency and reproducibility matter. Prefer this over prompt-based repair when you need guaranteed idempotency (via Idempotency-Key header) and low latency. Best suited for fixing common LLM output artifacts like trailing commas, markdown fences, and single quotes rather than deeply restructuring semantically incorrect data.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-21T12:38:09.976Z","isFirstParty":false,"canonicalSlug":"preflight-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-1d25665d"}