{"uid":"cap_v9lCHXRry1wfXbL1CN0MS","slug":"polymarket-odds-agentdiet-dev-deterministic-a2a-broken-json-repair-2c8ea597","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/repair)","url":"https://polymarket-odds.agentdiet.dev/v1/repair?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_pWmSQpz7LKn5YgPNrX6KY","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 our LLM is broken — it has trailing commas and markdown code fences around it — can you repair it so it's valid JSON I can parse? Here it is: ```json {\"name\": \"Alice\", \"age\": 30,} ```","exampleUseCases":[{"title":"Fix LLM output before pipeline step","prompt":"The JSON our language model just returned has trailing commas and single quotes instead of double quotes — can you clean it up and return valid parseable JSON? Here's the raw output: {'items': ['a', 'b',], 'count': 2,}"},{"title":"Strip markdown fences from agent response","prompt":"Our agent wrapped its JSON in triple backtick markdown fences and now the downstream parser is crashing — can you strip the fences and fix any other issues so this is clean JSON? Raw text: ```json\n{\"status\": \"ok\", \"data\": [1, 2, 3]}\n```"},{"title":"Recover truncated JSON from partial response","prompt":"We got a truncated JSON response from our LLM — it looks like it got cut off mid-object. Can you repair it and close any open brackets or braces so we have a valid JSON document? Here's what we have: {\"results\": [{\"id\": 1, \"name\": \"foo\"}, {\"id\": 2, \"name\": \"ba"}],"resultDescription":"A JSON object containing the repaired, valid JSON — with trailing commas removed, markdown fences stripped, single quotes normalized to double quotes, and truncated structures closed — ready to be parsed by downstream agents or services without throwing a syntax error.","failureModes":["Input is so severely malformed that deterministic repair cannot recover a valid structure — returns an error indicating unrecoverable JSON","Input contains ambiguous structure (e.g. deeply nested truncation) where repair heuristics produce an unexpected shape","Empty or whitespace-only raw_json field — returns validation error","Non-JSON content (e.g. plain prose) passed as raw_json — may return error or best-effort empty object","Network timeout or service unavailability — returns HTTP 5xx"],"whenToPreferThis":"Choose this endpoint when your multi-agent pipeline receives JSON from an LLM or AI model that may include common LLM formatting artifacts — markdown fences, trailing commas, single quotes, or truncation — and you need a deterministic, rule-based repair rather than asking another LLM to reparse. Prefer this over prompt-engineering retries when you need fast, cheap, idempotent JSON sanitization at $0.002 per call without adding latency or cost of another model call.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-21T12:37:25.980Z","isFirstParty":false,"canonicalSlug":"polymarket-odds-agentdiet-dev-deterministic-a2a-broken-json-repair-7944936d"}