{"uid":"cap_ikPh2gkrd90WKKVUn4sHs","slug":"polymarket-odds-agentdiet-dev-deterministic-a2a-broken-json-repair-88cd71a4","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/structured-output)","url":"https://polymarket-odds.agentdiet.dev/v1/structured-output?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_gtt0uC0mlcxKvhAqKjzLh","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 response came back with broken JSON — it has trailing commas, markdown code fences, and single quotes instead of double quotes. Can you repair it so I can use it in my pipeline? Here's the raw output: ```json {'name': 'Alice', 'age': 30,}```","exampleUseCases":[{"title":"Fixing LLM pipeline JSON crashes","prompt":"My agent just returned this malformed JSON with trailing commas and markdown fences and my pipeline crashed — can you clean it up and give me valid JSON back? Here it is: ```json {\"users\": [{\"id\": 1, \"name\": \"Bob\",}],}```"},{"title":"Sanitizing single-quoted AI responses","prompt":"The AI model returned JSON using single quotes instead of double quotes and now my downstream parser is failing. Can you repair this string into valid JSON: {'product': 'widget', 'price': 9.99, 'in_stock': True}"},{"title":"Recovering truncated structured output","prompt":"My LLM response got cut off mid-JSON and the object is incomplete — it ends abruptly without closing brackets. Can you deterministically repair this truncated output so I can extract the data: {\"results\": [{\"score\": 0.92, \"label\": \"positive\""}],"resultDescription":"Returns a repaired, valid JSON object reconstructed from the malformed input. The response includes the corrected JSON structure with all syntax errors resolved — trailing commas removed, markdown fences stripped, single quotes normalized to double quotes, and truncated structures closed — ready for downstream consumption in agent pipelines.","failureModes":["Input JSON is so severely malformed or meaningless that deterministic repair is impossible — returns error response","Empty or whitespace-only raw_json input — returns validation error","Input exceeds size limits — returns payload-too-large error","Payment not provided or insufficient — returns HTTP 402 requiring x402 payment","Network timeout if upstream service is temporarily unavailable"],"whenToPreferThis":"Choose this endpoint when your multi-agent pipeline receives LLM-generated JSON that fails to parse due to common LLM output quirks like trailing commas, markdown code fences, single quotes, or truncation. Prefer this over writing custom regex fixes when you need a deterministic, reliable repair layer that handles multiple failure modes at once. Ideal for production pipelines where JSON parse errors would crash downstream agents and manual intervention is not acceptable.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-21T00:36:44.805Z","isFirstParty":false,"canonicalSlug":"polymarket-odds-agentdiet-dev-deterministic-a2a-broken-json-repair-7944936d"}