{"uid":"cap_GNOHymMO4_zIoHeKS2DYy","slug":"token-intel-agentdiet-dev-deterministic-llm-json-repair-schema-865f2d8d","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://token-intel.agentdiet.dev/v1/llm-json-schema-healer)","url":"https://token-intel.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_pzN9rj5x_j9iSSVA9Ofbi","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"token-intel.agentdiet.dev","brandSlug":"token-intel-agentdiet-dev-mpp","brandBaseUrl":"https://token-intel.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Repairs truncated or malformed LLM-generated JSON (trailing commas, markdown fences, single quotes) into valid, parseable JSON for use in multi-agent pipelines","exampleAgentPrompt":"This JSON string I got from the LLM is broken — it has trailing commas and markdown fences around it. Can you repair it into valid JSON? Here it is: ```{\"name\": \"Alice\", \"role\": \"admin\",}```","exampleUseCases":[{"title":"Fixing LLM output before downstream agent call","prompt":"The AI model returned this JSON but it has trailing commas and single quotes, and my next pipeline step is crashing. Can you clean and repair it so it's valid? Here's the raw output: {'user': 'bob', 'score': 42,}"},{"title":"Stripping markdown fences from structured output","prompt":"My LLM wrapped its JSON response in triple backticks with a 'json' label and now my parser is failing. Can you strip the markdown fencing and return just the clean, valid JSON object?"},{"title":"Recovering truncated JSON from long generation","prompt":"My model hit its token limit mid-generation and the JSON got cut off mid-string. Here's the truncated output — can you repair and close it into valid JSON? {\"items\": [{\"id\": 1, \"name\": \"foo\"}, {\"id\": 2, \"name\": \"b"}],"resultDescription":"Returns a repaired, valid JSON object that has been deterministically fixed from the malformed input — with trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncations closed — making it safe to parse and pass to downstream agents or applications.","failureModes":["Input is so severely malformed that deterministic repair cannot infer intent — returns error or best-effort partial repair","Input is not JSON at all (plain text, binary, HTML) — may return error or empty result","Extremely long truncated JSON may lose semantic content during closure","Network or payment (x402) failure returns HTTP 402 or 5xx"],"whenToPreferThis":"Choose this endpoint when your multi-agent pipeline receives LLM-generated JSON that fails JSON.parse() due to common LLM output artifacts like trailing commas, markdown code fences, single quotes, or truncation. Ideal for deterministic (non-LLM) repair where you need consistent, reproducible fixing behavior rather than another LLM call to correct the output. Prefer over manual regex patching or calling a second LLM when you need fast, cheap, reliable JSON normalization at scale.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:23:07.817Z","isFirstParty":false,"canonicalSlug":"token-intel-agentdiet-dev-deterministic-llm-json-repair-schema-865f2d8d"}