{"uid":"cap_gbeBHsKhURyElohcAvHgG","slug":"defi-yield-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-e16a3eb1","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/malformed-json-healer)","url":"https://defi-yield.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_-doSF9geCGSHQEtr_4POQ","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 LLM is broken — it has trailing commas and markdown fences — can you fix it so I can parse it: ```{\"name\": \"Alice\", \"score\": 42,}```","exampleUseCases":[{"title":"Fix LLM pipeline JSON crash","prompt":"My agent just returned this malformed JSON with trailing commas and a markdown wrapper and my pipeline crashed — can you repair it so it's valid? Here it is: ```{\"status\": \"ok\", \"items\": [\"a\", \"b\",],}```"},{"title":"Sanitize single-quoted JSON response","prompt":"The model returned JSON using single quotes instead of double quotes and it won't parse — fix this for me: {'user': 'bob', 'active': true, 'score': 99}"},{"title":"Recover truncated JSON output","prompt":"My LLM's response got cut off mid-JSON and now it's truncated and invalid — here's the broken string, can you repair it and give me valid JSON back: {\"results\": [{\"id\": 1, \"name\": \"foo\"}, {\"id\": 2"}],"resultDescription":"A JSON object containing the repaired, valid JSON output — with markdown fences stripped, trailing commas removed, single quotes normalized to double quotes, and truncated structures closed — ready for downstream parsing by agents or pipelines.","failureModes":["JSON too severely corrupted to deterministically reconstruct — returns error indicating irreparable input","Input is not recognizable as JSON-like content — returns validation error","Empty or whitespace-only raw_json input — returns 400-style error for missing content","Payment not completed — returns HTTP 402 requiring x402 USDC micropayment before processing"],"whenToPreferThis":"Choose this endpoint when your multi-agent pipeline receives LLM-generated JSON that fails to parse due to common formatting issues like trailing commas, markdown fences, or single quotes, and you need a deterministic (non-probabilistic) repair rather than another LLM call. Ideal for high-throughput pipelines where JSON malformation is a recurring reliability problem and you need consistent, cheap ($0.002/call) automated healing without burning additional LLM tokens.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-21T12:35:23.508Z","isFirstParty":false,"canonicalSlug":"defi-yield-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-ff23e186"}