{"uid":"cap_R-0uFiOqDaFm5Q39h1xQt","slug":"github-audit-agentdiet-dev-deterministic-a2a-broken-json-repair-cc0bdacf","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/repair)","url":"https://github-audit.agentdiet.dev/v1/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_t1xjJQB4AY_8JxFnfRQ1Y","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 it becomes valid, parseable JSON for multi-agent pipelines.","exampleAgentPrompt":"The LLM just returned this broken JSON with trailing commas and markdown fences — can you repair it so it's valid and parseable: ```{\"name\": \"Alice\", \"age\": 30,}```?","exampleUseCases":[{"title":"Fix LLM output before downstream parsing","prompt":"My AI model returned this JSON but it has a trailing comma and it's wrapped in markdown — clean it up so I can pass it to the next step: ```json\n{\"user\": \"bob\", \"score\": 95,}\n```"},{"title":"Recover truncated agent pipeline response","prompt":"This JSON got cut off mid-string in my agent pipeline: `{\"results\": [{\"id\": 1, \"label\": \"cat\"` — can you repair it and give me back something valid?"},{"title":"Sanitize single-quoted JSON from tool output","prompt":"A tool in my workflow returned JSON using single quotes instead of double quotes: `{'status': 'ok', 'count': 42}` — fix it so it's proper JSON I can actually parse."}],"resultDescription":"A repaired, valid JSON object reconstructed from the malformed input. The response contains the cleaned JSON with issues like trailing commas, markdown code fences, and single quotes resolved so it can be parsed by standard JSON parsers downstream.","failureModes":["Input is so severely malformed it cannot be deterministically reconstructed — returns error or best-effort partial output","Input is not JSON at all (e.g. plain text or binary) — may return validation error","Truncated JSON with ambiguous structure may produce incorrect inference of missing fields","Payment failure via x402 if USDC balance is insufficient — HTTP 402 response","Very large JSON strings may hit query parameter length limits since input is passed via GET query param"],"whenToPreferThis":"Choose this endpoint when your multi-agent or LLM pipeline frequently receives malformed JSON from language model outputs and you need a deterministic, rule-based repair rather than asking another LLM to reformat it. Ideal when you need guaranteed idempotent behavior — the same broken input always produces the same repaired output. Prefer this over manual parsing hacks or regex when dealing with common LLM JSON antipatterns like markdown fences, trailing commas, and single quotes at scale.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:23:19.305Z","isFirstParty":false,"canonicalSlug":"github-audit-agentdiet-dev-deterministic-a2a-broken-json-repair-cc0bdacf"}