{"uid":"cap_wPeFkQwFC2ZlmS5n0w3xN","slug":"sec-intel-agentdiet-dev-llm-json-repair-schema-validator-7ae1a10d","name":"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://sec-intel.agentdiet.dev/v1/llm-json-schema-healer)","url":"https://sec-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_0cUD1sxk3LYnwlVXOUB6c","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"sec-intel.agentdiet.dev","brandSlug":"sec-intel-agentdiet-dev-mpp","brandBaseUrl":"https://sec-intel.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Deterministically repairs malformed, truncated, or markdown-wrapped JSON from LLM outputs so multi-agent pipelines can safely consume structured data","exampleAgentPrompt":"This JSON came back from another LLM and it's broken — there are trailing commas, it's wrapped in markdown fences, and it got cut off near the end. Can you repair it so I can actually parse it? Here's the raw string: ```json {\"name\": \"Alice\", \"score\": 95, \"tags\": [\"top\", \"performer\",] ```","exampleUseCases":[{"title":"Fix LLM output before database write","prompt":"The LLM just returned this JSON to store in our database but it has trailing commas and single quotes instead of double quotes — can you clean it up so it's valid before I save it? Here's the raw output: {'user': 'bob', 'status': 'active',}"},{"title":"Rescue truncated agent pipeline response","prompt":"My agent pipeline crashed because the upstream model returned a truncated JSON object that's missing its closing braces. Can you repair this broken JSON so the pipeline can continue? Raw string: {\"order_id\": 12345, \"items\": [{\"sku\": \"A1\", \"qty\": 2}"},{"title":"Strip markdown fences from structured LLM reply","prompt":"The AI assistant wrapped its JSON response in triple-backtick markdown fences and now my parser is rejecting it. Can you strip the fences and fix any other issues so I get clean, parseable JSON? Here it is: ```json\n{\"result\": \"success\", \"data\": [1,2,3,]}\n```"}],"resultDescription":"Returns a repaired, valid JSON object with syntax errors corrected — trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncated structures closed — ready for downstream parsing and consumption.","failureModes":["Input is so corrupted that deterministic repair cannot infer the intended structure, returning an error","Input contains no recoverable JSON structure at all","Truncated JSON is ambiguous about intended completion and may be repaired incorrectly","Payment via x402 fails or is rejected, blocking the request","Very long malformed strings may hit query parameter length limits since input is passed via GET"],"whenToPreferThis":"Choose this endpoint when LLM or agent outputs produce malformed JSON that crashes downstream parsers, especially in automated multi-agent pipelines where human intervention is not feasible. It is well-suited for fixing trailing commas, markdown wrapping, single-quote usage, and truncated structures in a deterministic (non-generative) way. Prefer it over writing custom regex-based fixers when you need a reliable, hosted repair step between LLM calls.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:23:01.029Z","isFirstParty":false,"canonicalSlug":"sec-intel-agentdiet-dev-llm-json-repair-schema-validator-7ae1a10d"}