{"uid":"cap_v2y31fY6jB5XU55ookD2I","slug":"polymarket-odds-agentdiet-dev-deterministic-llm-json-repair-schema-8522dd58","name":"Deterministic LLM 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/llm-json-schema-healer)","url":"https://polymarket-odds.agentdiet.dev/v1/llm-json-schema-healer?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_IbvVIEyeOQlPVMHJiWQ32","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-generated JSON (trailing commas, markdown fences, single quotes) to prevent multi-agent pipeline crashes.","exampleAgentPrompt":"The LLM just returned this messy JSON with trailing commas and markdown fences — can you clean it up and give me a valid JSON object? Here it is: ```json {\"name\": \"Alice\", \"age\": 30,} ```","exampleUseCases":[{"title":"Fix LLM output before database write","prompt":"My language model returned this JSON but it has single quotes and a trailing comma which is breaking my pipeline — repair it so I can store it: {'user': 'Bob', 'score': 42,}"},{"title":"Strip markdown fences from agent response","prompt":"The agent wrapped its JSON in triple backtick code fences and now my parser is crashing — can you strip the fences and fix the JSON so it's clean and valid?"},{"title":"Recover truncated JSON from timeout","prompt":"The LLM response got cut off mid-object and now the JSON is incomplete and broken — can you deterministically repair this truncated JSON so my workflow can continue?"}],"resultDescription":"A repaired, syntactically valid JSON object with common LLM output artifacts removed — including trailing commas, markdown fences, single-quoted keys/values, and truncation artifacts — ready for downstream parsing.","failureModes":["JSON too severely truncated to recover any meaningful structure","Input string contains no JSON-like content at all","Ambiguous repair cases where multiple valid completions exist","Rate limiting or payment failure via x402 protocol","Empty raw_json input returns validation error"],"whenToPreferThis":"Choose this endpoint when your multi-agent pipeline receives JSON from an LLM that frequently produces malformed output with trailing commas, markdown code fences, single quotes, or truncation errors. It is especially valuable in automated pipelines where crashes are costly and deterministic repair (not AI-based guessing) is required.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:24:45.729Z","isFirstParty":false,"canonicalSlug":"polymarket-odds-agentdiet-dev-deterministic-llm-json-repair-schema-239d220d"}