{"uid":"cap_zv1mk7sFAruwpRer6hQNC","slug":"onchain-risk-agentdiet-dev-deterministic-a2a-broken-json-repair-13be3a7d","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://onchain-risk.agentdiet.dev/v1/llm-json-schema-healer)","url":"https://onchain-risk.agentdiet.dev/v1/llm-json-schema-healer?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_0fU9z5WA0e2MBCVm5hcbF","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"onchain-risk.agentdiet.dev","brandSlug":"onchain-risk-agentdiet-dev-mpp","brandBaseUrl":"https://onchain-risk.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Repairs malformed, truncated, or LLM-generated JSON strings (trailing commas, markdown fences, single quotes) and returns valid, parseable JSON for use in multi-agent pipelines.","exampleAgentPrompt":"This JSON from the LLM is broken — it has trailing commas, single quotes, and a markdown code fence wrapping it. Can you repair it so I can parse it? Here it is: ```{'name': 'Alice', 'age': 30,}```","exampleUseCases":[{"title":"Fix LLM output before pipeline step","prompt":"The language model just returned this JSON with trailing commas and single quotes and my next agent step is crashing — can you repair it so it's valid? Here's the string: {'items': ['a', 'b',], 'count': 2,}"},{"title":"Strip markdown fences from agent response","prompt":"My coding agent returned JSON wrapped in triple backtick markdown fences and now I can't parse it. Can you clean it up and give me proper JSON? The raw output is: ```json\n{\"status\": \"ok\",\n\"result\": 42\n}```"},{"title":"Recover truncated JSON mid-pipeline","prompt":"The JSON response from one of my agents got cut off partway through and now it's invalid. Can you deterministically repair this truncated JSON so my pipeline can continue? Here it is: {\"name\": \"order_123\", \"items\": [{\"sku\": \"ABC\", \"qty\": 2}"}],"resultDescription":"A repaired, valid JSON object ready for programmatic parsing. The endpoint deterministically fixes common LLM JSON errors including trailing commas, single-quoted keys/values, markdown code fences, and truncated structures, returning a well-formed JSON response.","failureModes":["Input JSON too severely truncated or corrupted to recover — returns an error indicating unrecoverable structure","Input string is not JSON-like at all — endpoint may return an error or unexpected output","Ambiguous JSON structure where multiple repairs are plausible — deterministic repair may not match original intent","Empty or whitespace-only raw_json input — validation error returned"],"whenToPreferThis":"Choose this endpoint when your multi-agent or LLM pipeline receives JSON that fails JSON.parse() due to common LLM formatting errors (trailing commas, markdown fences, single quotes, minor truncation). It is deterministic and cheap ($0.002/call), making it suitable for inline pipeline healing before downstream processing steps. Prefer this over custom regex patching when you need a reliable, hosted, low-latency fix without maintaining your own JSON repair logic.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:24:25.603Z","isFirstParty":false,"canonicalSlug":"onchain-risk-agentdiet-dev-deterministic-a2a-broken-json-repair-2ee0e1c0"}