{"uid":"cap_PDTZdJbfnO3gvhtJJKQD3","slug":"onchain-risk-agentdiet-dev-deterministic-a2a-broken-json-repair-bdaa0a3e","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/malformed-json-healer)","url":"https://onchain-risk.agentdiet.dev/v1/malformed-json-healer?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_88dXpKWNn2X7CTRR-qYYJ","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":"This JSON string came back from the LLM and it won't parse — it has trailing commas and markdown code fences wrapped around it. Can you repair it and give me back clean, valid JSON? Here's the raw string: ```{\"name\": \"Alice\", \"age\": 30,}```","exampleUseCases":[{"title":"Fix LLM output before database write","prompt":"The agent just returned this JSON but it has single quotes and a trailing comma and my pipeline is crashing — please repair it into valid JSON so I can store it: {'user': 'bob', 'score': 42,}"},{"title":"Strip markdown fences from agent response","prompt":"My LLM wrapped its JSON output in triple-backtick markdown code fences again and now the parser is failing. Can you clean this up and return just the raw valid JSON object?"},{"title":"Recover truncated JSON mid-pipeline","prompt":"This JSON got cut off mid-string by the token limit and now nothing downstream can parse it. Try to deterministically repair it and give me back whatever valid JSON you can reconstruct: {\"items\": [{\"id\": 1, \"name\": \"widget\","}],"resultDescription":"A repaired, syntactically valid JSON object with all common LLM output corruption fixed — trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncated structures completed where possible.","failureModes":["JSON too severely malformed to recover deterministically — returns error indicating irreparable input","Empty or whitespace-only input rejected with validation error","Input that is not JSON-like at all may fail schema repair with an error response","Network or payment authorization failure returns HTTP 402 or 5xx"],"whenToPreferThis":"Choose this endpoint when you need deterministic, rule-based JSON repair rather than probabilistic LLM re-generation — ideal for multi-agent pipelines where consistency and reproducibility matter. Best for fixing known LLM output artifacts like trailing commas, markdown fences, and single-quoted keys. Prefer over asking a second LLM to reformat JSON when you want guaranteed structural fixes without stochastic variation.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-23T06:36:01.152Z","isFirstParty":false,"canonicalSlug":"onchain-risk-agentdiet-dev-deterministic-a2a-broken-json-repair-2ee0e1c0"}