{"uid":"cap_mBG9Hsm2myinUgyCrnoEM","slug":"polymarket-odds-agentdiet-dev-deterministic-a2a-broken-json-repair-bf3788e5","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://polymarket-odds.agentdiet.dev/v1/malformed-json-healer)","url":"https://polymarket-odds.agentdiet.dev/v1/malformed-json-healer?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_ahKQACTyVxO2zaAqWAz4R","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"polymarket-odds.agentdiet.dev","brandSlug":"polymarket-odds-agentdiet-dev-mpp","brandBaseUrl":"https://polymarket-odds.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":"The JSON my LLM just returned is broken — it has trailing commas and markdown code fences wrapping it. Can you run it through the malformed JSON healer to get back a clean, parseable object? Here's the raw string: ```{\"name\": \"Alice\", \"age\": 30,}```","exampleUseCases":[{"title":"LLM pipeline JSON crash recovery","prompt":"My agent's last step returned this mangled JSON with trailing commas and triple-backtick fences and now everything downstream is crashing — can you repair it so I can continue processing? Raw string: ```{\"result\": \"ok\", \"score\": 0.92,}```"},{"title":"Single-quote JSON normalization","prompt":"The LLM response came back using single quotes instead of double quotes and my JSON parser is throwing errors. Please fix this so it's valid JSON: {'user': 'bob', 'status': 'active'}"},{"title":"Truncated JSON completion fix","prompt":"My model output got cut off mid-response and the JSON is incomplete — it ends abruptly without closing brackets. Can you repair and complete this truncated JSON so my pipeline doesn't break: {\"items\": [{\"id\": 1, \"name\": \"widget\""}],"resultDescription":"A repaired, valid JSON object with all malformations corrected — trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncated structures closed — ready for safe parsing by downstream agents or systems.","failureModes":["Input JSON is so severely corrupted that deterministic repair cannot infer original structure — returns error with explanation","Input string is not JSON at all (e.g., plain text or HTML) — endpoint may return unparseable result or error","Extremely long truncated JSON may be ambiguously completable — repaired output may not match original intent","Network timeout or HTTP 402 payment failure if USDC payment is not properly configured"],"whenToPreferThis":"Choose this endpoint when your multi-agent pipeline receives malformed, truncated, or markdown-wrapped JSON from an LLM and needs a deterministic, rule-based fix rather than an AI-based rewrite. Ideal for production pipelines where consistency and predictability matter more than creative reconstruction. Prefer this over prompt-engineering retries when you need a fast, cheap ($0.002/call) synchronous repair step that won't alter semantics.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:26:16.104Z","isFirstParty":false,"canonicalSlug":"polymarket-odds-agentdiet-dev-deterministic-a2a-broken-json-repair-7944936d"}