{"uid":"cap_UVVpApuNNx82je0-i5t7N","slug":"onchain-risk-agentdiet-dev-deterministic-a2a-broken-json-repair-ea889051","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/structured-output)","url":"https://onchain-risk.agentdiet.dev/v1/structured-output?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_eK5GwF0Uab3u8-hXd-eQV","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 came back from my LLM with trailing commas and markdown fences and it's breaking my pipeline — can you repair it and give me back valid JSON? Here's the raw string: ```{\"name\": \"Alice\", \"score\": 42,}```","exampleUseCases":[{"title":"Fix LLM output in agent pipeline","prompt":"My agent just got this malformed JSON back from GPT-4 and the pipeline crashed — it has trailing commas and is wrapped in markdown backticks. Can you repair it into valid JSON? Here it is: ```{\"status\": \"ok\", \"items\": [1, 2, 3,],}```"},{"title":"Repair single-quoted JSON from chatbot","prompt":"I got this response from a chatbot that used single quotes instead of double quotes and now my JSON parser is failing. Can you fix it into proper valid JSON? The string is: {\"user\": 'john', 'active': true}"},{"title":"Recover truncated structured output","prompt":"My LLM response got cut off mid-generation and I ended up with a truncated JSON object that's missing its closing braces. Can you deterministically repair this fragment so I can continue processing? Here's what I have: {\"report\": {\"section\": \"summary\", \"data\": [1, 2"}],"resultDescription":"A repaired, valid JSON object parsed from the malformed input string, with all syntax errors corrected — trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncated structures closed.","failureModes":["Input JSON is too severely malformed or truncated to deterministically repair — returns error","Empty or null raw_json input — returns validation error","JSON is structurally ambiguous after truncation — repair may not match original intent","Payment required (HTTP 402) if x402 payment header is missing or insufficient"],"whenToPreferThis":"Choose this endpoint when an LLM or agent pipeline produces malformed JSON that needs deterministic, rule-based repair rather than AI-based reinterpretation. Ideal when you need predictable, repeatable fixes for known JSON syntax errors like trailing commas, markdown code fences, and single-quoted keys — without the cost or latency of sending the data back to an LLM for re-generation.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T12:35:19.411Z","isFirstParty":false,"canonicalSlug":"onchain-risk-agentdiet-dev-deterministic-a2a-broken-json-repair-2ee0e1c0"}