{"uid":"cap_bwM7OrqCb8JYpl2Ay-f3K","slug":"preflight-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-947f01f0","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/structured-output)","url":"https://preflight.agentdiet.dev/v1/structured-output?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_qzZTXeu6mdsVi3flxjiZ0","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":"The LLM just returned this broken JSON string with trailing commas and markdown fences — can you repair it so it's valid and parseable: ```{\"name\": \"Alice\", \"score\": 42,}```?","exampleUseCases":[{"title":"LLM pipeline JSON crash recovery","prompt":"My GPT-4 agent keeps returning JSON wrapped in triple backticks with trailing commas and it's crashing my pipeline — can you clean and repair this output so I can parse it: ```{\"status\": \"ok\", \"results\": [1, 2, 3,],}```?"},{"title":"Single-quoted JSON normalization","prompt":"I'm getting JSON back from a model that uses single quotes instead of double quotes, like {'user': 'bob', 'active': true} — fix it into valid JSON for me."},{"title":"Truncated structured output repair","prompt":"My agent returned a cut-off JSON response that ends mid-string: {\"report\": \"The analysis shows that revenue gre — can you repair and close it so I get a valid JSON object back?"}],"resultDescription":"A repaired, syntactically valid JSON object derived from the malformed input. The response contains the corrected structure with all detectable issues resolved, including removal of markdown fences, fixing trailing commas, converting single quotes to double quotes, and closing truncated strings or brackets.","failureModes":["Input is so severely malformed that repair is not deterministically possible, returning an error","Input string is empty or below minimum length","JSON is ambiguous in its truncation point, leading to uncertain repair outcomes","Network or service timeout for unusually large payloads"],"whenToPreferThis":"Choose this endpoint when your agent pipeline receives structured output from LLMs that may contain common JSON syntax errors such as markdown code fences, trailing commas, single quotes, or truncation. It is ideal for hardening multi-agent workflows where downstream steps require strict JSON parsing and crashes must be avoided. Prefer this over manual regex cleaning or custom parsers when you need deterministic, reliable repair without writing custom sanitization logic.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-21T06:36:07.550Z","isFirstParty":false,"canonicalSlug":"preflight-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-1d25665d"}