{"uid":"cap_uO1UdyE1je7LHtaXFDjUZ","slug":"polymarket-odds-agentdiet-dev-deterministic-a2a-broken-json-repair-04fa33a5","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/json-validator)","url":"https://polymarket-odds.agentdiet.dev/v1/json-validator?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_xW9vR527tmV6vgeM4jFEW","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 JSON string from the LLM has trailing commas and markdown fences and is crashing my pipeline — can you repair it and give me back valid JSON? Here's the raw output: ```{\"name\": \"Alice\", \"age\": 30,}```","exampleUseCases":[{"title":"Fixing LLM output in agent pipeline","prompt":"The language model just returned this malformed JSON with a trailing comma and it's breaking my downstream agent — can you repair it? Raw string: {\"status\": \"ok\", \"score\": 0.92,}"},{"title":"Stripping markdown fences from JSON","prompt":"My LLM wrapped its JSON response in triple backticks and now my parser can't read it. Can you clean this up and give me valid JSON? Here's what I got: ```json\n{\"result\": \"success\", \"data\": [1, 2, 3]}\n```"},{"title":"Repairing single-quoted JSON keys","prompt":"I got this JSON back from a model that used single quotes instead of double quotes and it won't parse — can you fix it? Here's the string: {'user': 'bob', 'active': true}"}],"resultDescription":"A repaired, valid JSON object with all common malformation issues corrected — trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncated structures closed — ready for downstream parsing without errors.","failureModes":["raw_json parameter missing or empty — returns 400 error","JSON is so severely malformed that deterministic repair cannot recover structure — returns error or best-effort partial result","Payment not provided — returns HTTP 402 requiring x402 micropayment","Input exceeds length limits — may return 413 or truncation error","Non-JSON input passed (e.g. plain text, binary) — repair may fail or return unexpected result"],"whenToPreferThis":"Choose this endpoint when you need deterministic, rule-based JSON repair for LLM outputs in automated multi-agent pipelines where reliability and predictability matter more than AI-based guessing. Ideal when JSON malformations are known and systematic (trailing commas, markdown fences, single quotes, truncation) rather than semantic errors. Prefer over manual parsing hacks or LLM re-prompting when you need a cheap, fast, idempotent fix at $0.002 per call.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:23:13.750Z","isFirstParty":false,"canonicalSlug":"polymarket-odds-agentdiet-dev-deterministic-a2a-broken-json-repair-7944936d"}