{"uid":"cap_3pObwctc89s--2ipbB2f7","slug":"polymarket-odds-agentdiet-dev-deterministic-a2a-broken-json-repair-11c59f16","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-normalizer)","url":"https://polymarket-odds.agentdiet.dev/v1/json-normalizer?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_IyzJRMT8KH_QwhF6sXZIA","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 malformed, truncated, or markdown-wrapped JSON strings (trailing commas, single quotes, fences) into valid, parseable JSON for multi-agent pipelines.","exampleAgentPrompt":"This JSON came back from our LLM step and it's broken — trailing commas, single quotes, wrapped in a markdown code fence. Can you fix it so it parses cleanly? Here's the raw string: ```{'name': 'Alice', 'age': 30,}```","exampleUseCases":[{"title":"Fixing LLM pipeline JSON crashes","prompt":"Our agent pipeline keeps crashing because the language model returns JSON with trailing commas and markdown fences. Can you repair this malformed output so it's valid JSON: ```json\\n{\"items\": [\"a\", \"b\",],\\n\"count\": 2\\n}\\n```?"},{"title":"Normalizing single-quoted JSON from LLM","prompt":"The LLM in our workflow returned JSON using single quotes instead of double quotes and it won't parse. Fix this for me: {'user': 'bob', 'score': 95, 'active': true}"},{"title":"Recovering truncated JSON output","prompt":"Our model got cut off mid-response and returned an incomplete JSON object. Can you repair and close it so we can continue processing? Here's what we got: {\"results\": [{\"id\": 1, \"name\": \"item one\"}, {\"id\": 2"}],"resultDescription":"A JSON object containing the repaired, fully valid JSON. The response will be a parseable JSON structure derived from the input malformed string, with all syntax errors corrected — trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncated structures closed.","failureModes":["Input is so severely malformed that deterministic repair is impossible — returns error indicating unrecoverable structure","Empty or whitespace-only raw_json string — rejected with validation error","Input that is not JSON-like at all (plain prose, binary data) — may return error or empty result","Rate limiting or payment issues with x402 protocol — returns 402 Payment Required","Server timeout on extremely large malformed JSON strings"],"whenToPreferThis":"Choose this endpoint when you need deterministic, rule-based JSON repair rather than LLM-based re-generation — it's ideal for multi-agent pipelines where reliability and consistency matter more than inference. Prefer it over retrying the LLM when the JSON structure is mostly intact but has common syntactic issues like trailing commas, markdown wrapping, or single quotes. Use it as a middleware layer between LLM output steps and downstream JSON consumers to prevent parse errors without adding latency or cost of another LLM call.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-23T06:36:43.330Z","isFirstParty":false,"canonicalSlug":"polymarket-odds-agentdiet-dev-deterministic-a2a-broken-json-repair-7944936d"}