{"uid":"cap_xwxDL_8aiC8UUPUkcl2zV","slug":"onchain-risk-agentdiet-dev-deterministic-a2a-broken-json-repair-b76aaf86","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-fix)","url":"https://onchain-risk.agentdiet.dev/v1/json-fix?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_NnL-6xKo1QgROBji-s8Gd","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-generated JSON (trailing commas, markdown fences, single quotes) so multi-agent pipelines can continue without crashing.","exampleAgentPrompt":"This JSON from my LLM pipeline is broken — it has trailing commas and markdown fences wrapping it. Can you fix it so it's valid JSON I can parse? Here's the raw output: ```{\"name\": \"Alice\", \"score\": 42,}```","exampleUseCases":[{"title":"Fixing LLM output in agent pipeline","prompt":"My language model just returned this malformed JSON with a trailing comma and it's breaking my downstream agent — can you repair it? The raw string is: {\"status\": \"ok\", \"items\": [1, 2, 3,]}"},{"title":"Stripping markdown fences from JSON","prompt":"The AI returned JSON wrapped in markdown code fences and my parser is choking on it. Can you clean it up and give me valid JSON? Here's what I got: ```json\n{\"user\": \"bob\", 'role': 'admin'}\n```"},{"title":"Recovering truncated JSON response","prompt":"My LLM response got cut off mid-JSON and now the object is incomplete — it ends abruptly without closing braces. Can you repair this truncated JSON so I can continue processing? Here it is: {\"order_id\": 99, \"items\": [{\"sku\": \"ABC\", \"qty\": 2"}],"resultDescription":"A repaired, valid JSON object derived from the malformed input string. The response contains the fixed JSON with syntax errors corrected, markdown fences stripped, single quotes replaced with double quotes, trailing commas removed, and truncated structures closed where possible.","failureModes":["Input JSON is too severely corrupted to deterministically repair — returns error indicating unrecoverable structure","raw_json parameter missing or empty — returns 400-level validation error","Input is not JSON-like at all (e.g. plain text or binary) — repair may fail or return unexpected output","Very long truncated JSON may have ambiguous completion — repaired output may not match original intent"],"whenToPreferThis":"Choose this endpoint when your multi-agent or LLM pipeline receives syntactically broken JSON that needs deterministic, rule-based repair rather than AI-based rewriting. Ideal for stripping markdown fences, fixing trailing commas, correcting single quotes, or closing truncated structures. Prefer this over custom parsing logic when you need a reliable, low-latency, pay-per-call fix that integrates with x402/MCP infrastructure.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T12:51:34.447Z","isFirstParty":false,"canonicalSlug":"onchain-risk-agentdiet-dev-deterministic-a2a-broken-json-repair-2ee0e1c0"}