{"uid":"cap_bfN2ttY1v0Lh23E7hcw7H","slug":"polymarket-odds-agentdiet-dev-deterministic-a2a-broken-json-repair-b5a7e4b7","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-fix)","url":"https://polymarket-odds.agentdiet.dev/v1/json-fix?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_ndguN-97uUW_AC4gb_fq0","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 came back from the LLM and it won't parse — it has trailing commas, markdown fences, and some single quotes. Can you run it through the JSON repair service and give me back clean, valid JSON? Here's the raw string: ```json {name: 'Alice', scores: [1, 2, 3,], active: true,}```","exampleUseCases":[{"title":"Fix LLM output in agent pipeline","prompt":"The JSON my LLM just returned has trailing commas and markdown code fences and it's breaking my pipeline — please repair it and return valid parseable JSON: ```json {\"user\": 'bob', \"tags\": [\"admin\", \"user\",],}```"},{"title":"Recover truncated API response JSON","prompt":"My agent got a truncated JSON response that cuts off mid-object and won't parse. Can you attempt to repair and close it so I can extract the data? Here's what I have: {\"id\": 42, \"name\": \"Product Alpha\", \"attributes\": {\"color\": \"red\""},{"title":"Sanitize single-quoted JSON before schema validation","prompt":"I have a JSON string from an older system that uses single quotes instead of double quotes and has a few trailing commas — please fix it to valid RFC-compliant JSON so I can validate it against my schema: {'company': 'Acme', 'employees': [10, 20,]}"}],"resultDescription":"A repaired, valid JSON object reconstructed from the malformed input. The response includes the fixed JSON structure with all syntax errors corrected — trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncated structures closed where possible.","failureModes":["Input is so severely malformed that deterministic repair is impossible — returns error indicating unrecoverable JSON","Empty or whitespace-only raw_json string — validation error returned","Input is not JSON at all (e.g. plain English text) — returns error or best-effort parse failure","Network timeout or upstream service unavailability — HTTP 5xx response","Payment not provided or insufficient — HTTP 402 payment required"],"whenToPreferThis":"Choose this endpoint when your multi-agent pipeline receives LLM-generated or third-party JSON that frequently contains syntax errors like trailing commas, markdown code fences, single quotes, or truncation — and you need a deterministic, non-LLM repair that won't hallucinate or alter field values. Prefer it over asking another LLM to fix the JSON, as that introduces non-determinism and cost.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-21T12:37:55.116Z","isFirstParty":false,"canonicalSlug":"polymarket-odds-agentdiet-dev-deterministic-a2a-broken-json-repair-7944936d"}