{"uid":"cap_psq6lo6xWQgwI0tg_ZRU4","slug":"github-audit-agentdiet-dev-deterministic-a2a-broken-json-repair-b28505f8","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://github-audit.agentdiet.dev/v1/structured-output)","url":"https://github-audit.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_QuBt-m7U0suxyUR3SQRTN","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"github-audit.agentdiet.dev","brandSlug":"github-audit-agentdiet-dev-mpp","brandBaseUrl":"https://github-audit.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Repairs truncated or malformed LLM-generated JSON (trailing commas, markdown fences, single quotes) so multi-agent pipelines can process outputs without crashing","exampleAgentPrompt":"This LLM response came back as broken JSON with trailing commas and markdown code fences — can you repair it so it parses cleanly? Here it is: ```json {name: 'Alice', age: 30,} ```","exampleUseCases":[{"title":"Fix LLM output in agent pipeline","prompt":"My language model just returned a JSON blob with trailing commas and single quotes instead of double quotes — it's breaking my pipeline. Can you repair this string so it's valid JSON: `{'user': 'Bob', 'score': 42,}`?"},{"title":"Strip markdown fences from structured output","prompt":"The LLM wrapped its JSON response in a markdown code block and now my parser is throwing an error. Can you clean up this output and give me a proper JSON object: ```json\n{\"status\": \"ok\", \"items\": [1, 2, 3,]}\n```?"},{"title":"Recover truncated JSON from crashed generation","prompt":"The model got cut off mid-generation and I have a truncated JSON string that won't parse. Can you deterministically repair this and give me back the best valid JSON you can: `{\"name\": \"Acme Corp\", \"employees\": 500, \"tags\": [`?"}],"resultDescription":"Returns a repaired, valid JSON object parsed from the malformed input string, with common LLM output issues such as trailing commas, markdown code fences, single-quoted keys/values, and truncation corrected deterministically.","failureModes":["Input is so severely truncated that meaningful repair is impossible — returns error or best-effort partial result","Input is not JSON-like at all (plain prose, binary data) — may return error or empty object","Ambiguous structure where multiple valid repairs exist — deterministic approach picks one which may not match original intent","Payment required (HTTP 402) if x402 payment header is missing or insufficient"],"whenToPreferThis":"Choose this endpoint when you need deterministic, rule-based JSON repair of LLM outputs in a multi-agent pipeline and cannot tolerate parse errors. It is especially useful when dealing with markdown-wrapped, trailing-comma, or single-quoted JSON that fails standard parsers. Prefer this over asking the LLM to re-generate if you need a fast, cheap, and predictable fix without an additional model call.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-21T06:46:17.389Z","isFirstParty":false,"canonicalSlug":"github-audit-agentdiet-dev-deterministic-a2a-broken-json-repair-cc0bdacf"}