{"uid":"cap_UN2L0v0XcgbeMWewSvgQ4","slug":"onchain-risk-agentdiet-dev-deterministic-a2a-broken-json-repair-f9fc8cb2","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":"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_R338LuwXnWO54VHOXY4lJ","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 from my LLM has trailing commas and markdown code fences and it's crashing my pipeline — can you clean it up and give me valid JSON back? Here it is: ```json {\"name\": \"Alice\", \"score\": 42,} ```","exampleUseCases":[{"title":"Fix LLM output crashing agent pipeline","prompt":"My agent just got back this broken JSON from the model and it's throwing a parse error — trailing comma and it's wrapped in markdown fences. Can you repair it so the next step in my pipeline can use it? The raw output is: ```json {\"status\": \"ok\", \"results\": [1, 2, 3,],} ```"},{"title":"Normalize single-quoted JSON from model","prompt":"The LLM returned JSON using single quotes instead of double quotes and my parser is rejecting it. Can you fix this so it's valid JSON? Here's what came back: {'user': 'bob', 'active': true, 'score': 99}"},{"title":"Recover truncated JSON response","prompt":"My model response got cut off mid-output and the JSON is incomplete — it just ends abruptly without closing braces. Can you repair it and give me back something parseable? Here's the truncated string: {\"company\": \"Acme\", \"revenue\": 5000000, \"employees\": [\"Alice\", \"Bob\""}],"resultDescription":"A repaired, fully valid JSON object with all syntax errors corrected — trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncated structures closed. The response is a JSON object containing the fixed output ready for downstream parsing.","failureModes":["Input is so severely malformed that deterministic repair cannot infer the original structure — returns error indicating unrecoverable JSON","Input string is empty or missing the required raw_json field — returns 400-level validation error","Ambiguous truncation where multiple valid completions exist — repair may produce unexpected but syntactically valid output","Payment not provided or insufficient — returns HTTP 402 requiring x402 micropayment","Rate limiting or service unavailability — returns 5xx error"],"whenToPreferThis":"Choose this endpoint when you need deterministic, rule-based JSON repair rather than LLM-based rewriting — it's ideal for multi-agent pipelines where consistency and predictability matter more than inference. Prefer it over manual regex fixes or retry loops when LLM outputs frequently arrive with trailing commas, markdown fences, or single quotes. It's especially valuable in production agent workflows where crashes from malformed JSON are unacceptable and you need a cheap, fast, idempotent sanitization step.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-18T00:41:47.271Z","isFirstParty":false,"canonicalSlug":"onchain-risk-agentdiet-dev-deterministic-a2a-broken-json-repair-2ee0e1c0"}