{"uid":"cap_3KAJea2YIJ8iAk3IS7rT-","slug":"polymarket-odds-agentdiet-dev-deterministic-llm-json-repair-schema-239d220d","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_wR3LkiNU9-4QmZ_4zEUN0","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 LLM JSON outputs (trailing commas, single quotes, markdown fences) to prevent multi-agent pipeline crashes","exampleAgentPrompt":"This JSON from the LLM has trailing commas and markdown code fences and won't parse — can you run it through the JSON healer to get back a clean, valid object? Here it is: ```json {\"name\": \"Alice\", \"score\": 42, }```","exampleUseCases":[{"title":"Fix LLM output before database write","prompt":"The agent upstream gave me this JSON but it has single quotes instead of double quotes and a trailing comma — heal it so I can safely write it to the database: {'user': 'bob', 'status': 'active',}"},{"title":"Repair truncated JSON mid-pipeline","prompt":"My pipeline step got this truncated JSON from the model and now the next step is crashing — can you repair it and return a valid object? Here's the broken output: {\"items\": [{\"id\": 1, \"name\": \"Widget\""},{"title":"Strip markdown fences from agent response","prompt":"The LLM wrapped its JSON output in triple-backtick markdown fences and now my parser throws an error — please clean it up and give me back raw valid JSON: ```json\n{\"status\": \"ok\", \"count\": 5}\n```"}],"resultDescription":"A repaired, valid JSON object with all syntax errors corrected — trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncated structures closed — ready for immediate use in downstream pipeline steps.","failureModes":["Input JSON is so severely malformed that deterministic repair is impossible — returns an error indicating the string is unrecoverable","Empty or missing raw_json parameter causes a validation error","Input is not JSON at all (e.g. plain prose) and cannot be coerced into a valid object","Extremely long or deeply nested JSON may exceed processing limits"],"whenToPreferThis":"Choose this endpoint when your multi-agent pipeline receives LLM-generated JSON that is syntactically broken (trailing commas, markdown fences, single quotes, truncation) and you need a deterministic, rule-based fix rather than asking another LLM to rewrite it. Ideal for production pipelines where reliability and repeatability matter more than creative reinterpretation of ambiguous structure.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:26:17.562Z","isFirstParty":false,"canonicalSlug":"polymarket-odds-agentdiet-dev-deterministic-llm-json-repair-schema-239d220d"}