{"uid":"cap_aVSJ_iI22Z08-xmJFqc3p","slug":"agentdiet-dev-deterministic-a2a-broken-json-repair-schema-validator-dd9f7439","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://agentdiet.dev/v1/repair)","url":"https://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_nZkm1SiCaAKdVKJDo5Hvw","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"agentdiet.dev","brandSlug":"agentdiet-dev-mpp","brandBaseUrl":"https://agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Repairs truncated or malformed LLM JSON outputs (trailing commas, markdown fences, single quotes) into valid JSON so multi-agent pipelines don't crash.","exampleAgentPrompt":"This JSON from my LLM response is broken — it has trailing commas, markdown code fences, and single quotes — can you repair it into valid JSON? Here's the raw string: ```json {'name': 'Alice', 'age': 30,}```","exampleUseCases":[{"title":"Fixing LLM output before downstream processing","prompt":"My language model just returned this JSON with trailing commas and backtick fences and it's breaking my pipeline — can you repair it into valid JSON? Here it is: ```json {'user': 'bob', 'score': 42,}```"},{"title":"Recovering truncated agent API response","prompt":"My agent got a truncated JSON response that cuts off mid-string — can you repair this broken JSON so I can continue processing it? The raw string is: {\"items\": [{\"id\": 1, \"name\": \"widget\", \"price\":"},{"title":"Sanitizing single-quoted JSON from code generation","prompt":"My code generator produced this JSON using single quotes instead of double quotes and it won't parse — please fix it into valid JSON: {'product': 'laptop', 'qty': 3, 'available': true}"}],"resultDescription":"A JSON object containing the repaired, syntactically valid version of the input. The malformed input is cleaned of issues such as trailing commas, markdown fences, single quotes, and truncation artifacts, returning a parseable JSON structure the agent can immediately use.","failureModes":["Input JSON too severely malformed or truncated to infer correct structure — may return error or best-effort partial repair","Empty or null raw_json input triggers validation error","Non-JSON content (plain text, binary) passed as input returns parse failure","Ambiguous truncation point where multiple valid completions exist — result may not match original intent","Rate-limiting or payment failure (x402) if quota exceeded"],"whenToPreferThis":"Choose this endpoint when an AI agent or multi-agent pipeline receives syntactically broken JSON from an LLM output stage — especially when the issues are common patterns like trailing commas, markdown code fences wrapping the JSON, single-quoted keys/values, or truncated strings. It is deterministic (not heuristic or ML-based), making it predictable and suitable for automated pipelines where consistency matters. Prefer this over writing custom regex fixes when you need reliable, repeatable JSON repair without maintaining your own parsing logic.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:23:51.427Z","isFirstParty":false,"canonicalSlug":"agentdiet-dev-deterministic-a2a-broken-json-repair-schema-validator-dd9f7439"}