{"uid":"cap_vkKA9VOb2gbr2OH3pFaup","slug":"onchain-risk-agentdiet-dev-deterministic-a2a-broken-json-repair-4c25d268","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/json-normalizer)","url":"https://onchain-risk.agentdiet.dev/v1/json-normalizer?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_VQOZ-vWHiQ5xA-dRVM5aI","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 markdown-wrapped JSON strings (trailing commas, single quotes, code fences) into valid JSON so multi-agent pipelines don't crash.","exampleAgentPrompt":"This LLM output came back as broken JSON with markdown fences and trailing commas — can you repair it and give me back valid JSON? Here it is: ```json {\"name\": \"Alice\", \"score\": 42,} ```","exampleUseCases":[{"title":"Fix LLM output before downstream processing","prompt":"My language model just returned this JSON but it has trailing commas and single quotes and my parser is crashing — can you repair it so I can pass it to the next step? Here's the raw output: {'user': 'bob', 'items': ['a', 'b',]}"},{"title":"Strip markdown fences from agent response","prompt":"The agent response came back wrapped in triple-backtick markdown code fences and I need clean JSON to store in my database — can you normalize this output and give me valid JSON? The raw string is: ```json\n{\"status\": \"ok\", \"count\": 5}\n```"},{"title":"Recover truncated JSON from interrupted generation","prompt":"The model got cut off mid-response and the JSON is incomplete — it ends abruptly without closing brackets. Can you deterministically repair this truncated JSON so I can parse it? Here it is: {\"results\": [{\"id\": 1, \"value\": \"hello\""}],"resultDescription":"A repaired, valid JSON object that has been cleaned of common LLM-introduced defects including trailing commas, markdown code fences, single quotes, and truncation artifacts — ready for downstream parsing and use.","failureModes":["Input JSON is too severely malformed to deterministically recover (e.g. missing entire structural sections)","Ambiguous repair paths where multiple valid interpretations exist may produce unexpected output","Empty or whitespace-only input returns an error","Payment (x402) not included or invalid USDC balance causes 402 response before processing"],"whenToPreferThis":"Choose this endpoint when your multi-agent pipeline receives raw LLM JSON outputs that frequently contain trailing commas, markdown fences, single quotes, or truncation — and you need a deterministic (non-AI) repair rather than asking another LLM to fix it, which risks introducing hallucinations or changing content.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-21T06:47:32.128Z","isFirstParty":false,"canonicalSlug":"onchain-risk-agentdiet-dev-deterministic-a2a-broken-json-repair-2ee0e1c0"}