{"uid":"cap_I9oW-nYaYSUXH6bBgJWhh","slug":"defi-yield-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-4d8f1211","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://defi-yield.agentdiet.dev/v1/schema-repair)","url":"https://defi-yield.agentdiet.dev/v1/schema-repair?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_ASA6EWmf5x9LMr7opR0BI","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"defi-yield.agentdiet.dev","brandSlug":"defi-yield-agentdiet-dev-mpp","brandBaseUrl":"https://defi-yield.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 from the last LLM step has trailing commas and markdown code fences and it keeps crashing my pipeline — can you repair it so I get back valid, parseable JSON? Here it is: ```json {\"name\": \"Alice\", \"score\": 42, } ```","exampleUseCases":[{"title":"Fix LLM output crashing agent pipeline","prompt":"My agent just got this broken JSON back from GPT-4 and the downstream step is throwing a parse error — it has trailing commas and backtick fences. Can you repair it into valid JSON? The string is: ```json {\"user\": \"bob\", \"tokens\": 150, } ```"},{"title":"Sanitize single-quote JSON before database insert","prompt":"I have a JSON blob that came back from a language model using single quotes instead of double quotes, like {'city': 'New York', 'pop': 8000000} — can you fix it into proper valid JSON so I can insert it into my database?"},{"title":"Recover truncated JSON mid-token from streaming LLM","prompt":"My streaming LLM call got cut off mid-response and I ended up with truncated JSON that ends abruptly without closing braces. The raw string is: {\"report\": {\"title\": \"Q1 Summary\", \"items\": [\"revenue\", \"costs\" — can you repair it into valid JSON?"}],"resultDescription":"Returns a JSON object containing the repaired, validated JSON that was originally malformed. The response includes the cleaned JSON structure with all syntax errors corrected — trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncated structures closed — ready for downstream parsing.","failureModes":["Input JSON too ambiguous or corrupted to deterministically repair — returns error indicating unrecoverable structure","Empty or null raw_json parameter — returns validation error","JSON repair results in structurally ambiguous output — multiple valid interpretations possible","Network or service timeout on large payloads","HTTP 402 payment required if x402 micropayment not included"],"whenToPreferThis":"Choose this endpoint when your multi-agent pipeline receives malformed JSON from LLM outputs and needs a deterministic, rule-based repair rather than asking the LLM to regenerate. Ideal for production pipelines where retrying an LLM call is expensive or introduces latency, and when the corruption is syntactic (trailing commas, markdown wrapping, single quotes, truncation) rather than semantic. Prefer this over ad-hoc regex or LLM-based repair when you need reproducible, idempotent behavior.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:21:24.916Z","isFirstParty":false,"canonicalSlug":"defi-yield-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-ff23e186"}