{"uid":"cap_P_rbug_IRqw4O5CKKU80R","slug":"polymarket-odds-agentdiet-dev-deterministic-a2a-broken-json-repair-c2ec0c24","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":"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_OcNS9r2ywoncO4ZZMVQ5V","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":"This LLM output came back as broken JSON with trailing commas and markdown code fences — can you fix it so my pipeline doesn't crash? Here's the raw string: ```{\"name\": \"Alice\", \"score\": 42,}```","exampleUseCases":[{"title":"Fix LLM pipeline broken JSON","prompt":"My language model keeps returning JSON wrapped in markdown code fences with trailing commas and it's crashing my downstream agent — can you repair this string so it's valid JSON: ```{\"user\": 'Bob', \"active\": true,}```"},{"title":"Sanitize single-quoted JSON keys","prompt":"I have JSON that came back from an AI with single quotes instead of double quotes around all the keys and values — fix it into proper valid JSON for me: {'product': 'widget', 'price': 9.99, 'in_stock': true}"},{"title":"Recover truncated JSON response","prompt":"My LLM response got cut off halfway and the JSON is truncated — it ends abruptly mid-object. Can you try to repair it into valid JSON so I can continue processing? Here's what I have: {\"items\": [{\"id\": 1, \"name\": \"apple\"}, {\"id\": 2, \"name\": \"ban"}],"resultDescription":"Returns a repaired, fully valid JSON object parsed from the input malformed or truncated string, with all syntax errors corrected including removed markdown fences, fixed trailing commas, converted single quotes to double quotes, and completed truncated structures where possible","failureModes":["Input JSON is too severely truncated to deterministically infer structure — returns error indicating unrecoverable input","Input string contains no JSON-like content at all — returns validation error","Ambiguous repair paths where multiple valid repairs are possible — may return one valid interpretation with a warning","Network timeout or service unavailability — returns 5xx error","Malformed input that exceeds payload size limits — returns 413 or equivalent error"],"whenToPreferThis":"Use this endpoint when your multi-agent pipeline receives raw LLM JSON outputs that may contain markdown fences, trailing commas, single quotes, or truncation artifacts and you need deterministic repair rather than probabilistic re-generation. Prefer this over asking an LLM to fix the JSON (non-deterministic, costly) or writing custom regex (brittle). Ideal for production pipelines where reliability and idempotency are critical.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-21T18:30:32.161Z","isFirstParty":false,"canonicalSlug":"polymarket-odds-agentdiet-dev-deterministic-a2a-broken-json-repair-7944936d"}