{"uid":"cap_nq7FOo2apHYEV1I3QOMuK","slug":"onchain-risk-agentdiet-dev-deterministic-a2a-broken-json-repair-af1e672d","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/schema-repair)","url":"https://onchain-risk.agentdiet.dev/v1/schema-repair?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_Hvk04rMVPymJUwGaVRGWg","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 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 with trailing commas and markdown fences — can you repair it so it's valid JSON I can parse? Here's the raw string: ```{\"name\": \"Alice\", \"age\": 30,}```","exampleUseCases":[{"title":"Fix LLM pipeline JSON crash","prompt":"My agent pipeline keeps crashing because the LLM is returning JSON with trailing commas and unclosed brackets — can you repair this malformed string so I can parse it safely? Here it is: {\"results\": [\"foo\", \"bar\",}"},{"title":"Strip markdown fences from model output","prompt":"The model wrapped its JSON output in triple backticks and I can't parse it directly — please repair and extract the clean JSON from this string: ```json\n{\"status\": \"ok\", \"score\": 0.95}\n```"},{"title":"Repair single-quoted JSON from agent response","prompt":"I'm getting a JSON response from another agent that uses single quotes instead of double quotes, like {'key': 'value'} — can you fix it into valid JSON so my system can process it?"}],"resultDescription":"A repaired, well-formed JSON object derived from the malformed input string. The endpoint deterministically corrects issues such as trailing commas, markdown code fences, single-quoted keys/values, and truncated structures, returning valid parseable JSON.","failureModes":["Input is so severely malformed it cannot be deterministically repaired — returns an error indicating repair failure","Input string is empty or missing the required raw_json field — returns a 400-level validation error","Ambiguous truncation where the intended structure cannot be inferred — may return partial or best-effort repair with a warning","Payment not received or x402 payment flow fails — returns 402 Payment Required"],"whenToPreferThis":"Choose this endpoint when your multi-agent or LLM pipeline receives JSON that is syntactically broken — trailing commas, markdown fences, single quotes, or truncation — and you need a deterministic, rule-based repair rather than a generative rewrite. It is ideal for hardening agent orchestration layers where reliability and idempotency are critical, and where you cannot afford to re-query the LLM.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-21T12:40:18.970Z","isFirstParty":false,"canonicalSlug":"onchain-risk-agentdiet-dev-deterministic-a2a-broken-json-repair-2ee0e1c0"}