{"uid":"cap_bKHxPSn0L8inyt7GDwPJU","slug":"shopify-spy-agentdiet-dev-deterministic-llm-json-repair-schema-8c23dcfa","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://shopify-spy.agentdiet.dev/v1/llm-json-schema-healer)","url":"https://shopify-spy.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_aaZpGpzIIz0W2rMWuuGYP","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"shopify-spy.agentdiet.dev","brandSlug":"shopify-spy-agentdiet-dev-mpp","brandBaseUrl":"https://shopify-spy.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Repairs truncated or malformed LLM-generated JSON (trailing commas, markdown fences, single quotes) into valid, parseable JSON for multi-agent pipelines","exampleAgentPrompt":"My LLM just returned this broken JSON with trailing commas and markdown fences — can you repair it so it's valid and parseable? Here it is: ```json {\"name\": \"Alice\", \"age\": 30, } ```","exampleUseCases":[{"title":"Multi-agent pipeline JSON sanitization","prompt":"The previous agent in my pipeline returned JSON with trailing commas and single quotes that's crashing my parser — fix this malformed string so my next agent can use it: {name: 'Bob', score: 42,}"},{"title":"LLM output markdown fence stripping","prompt":"My language model wrapped its JSON response in a markdown code block and now my system can't parse it — strip the fences and repair any issues in this output: ```json {\"items\": [1, 2, 3,]} ```"},{"title":"Truncated JSON recovery for automation bot","prompt":"My automation received a JSON payload that got cut off mid-sentence from the LLM — can you try to reconstruct and repair this truncated JSON so I can extract the fields I need? Here's what I have: {\"user\": \"carol\", \"settings\": {\"theme\": \"dark\""}],"resultDescription":"A JSON object containing the repaired, valid JSON output. The malformed input is deterministically fixed — trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncated structures closed — returning a parseable JSON structure ready for downstream agent consumption.","failureModes":["JSON too severely truncated or corrupted to repair deterministically — returns error or best-effort partial result","Input is not recognizable as JSON at all (e.g. plain prose) — repair may fail or return unexpected output","Schema validation mismatch if the repaired JSON doesn't conform to an expected schema","Empty or whitespace-only raw_json input — returns validation error","Network timeout or upstream service unavailability — HTTP 5xx response","Payment failure via x402 protocol — HTTP 402 response requiring USDC micropayment"],"whenToPreferThis":"Choose this endpoint when your multi-agent or LLM pipeline frequently receives malformed JSON — especially outputs with trailing commas, single-quoted keys, or markdown code fences — that need deterministic, rule-based repair rather than probabilistic regeneration. Ideal when you cannot re-prompt the LLM, need sub-second repair latency, and want a lightweight fix step between agents in an automated workflow.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:23:26.224Z","isFirstParty":false,"canonicalSlug":"shopify-spy-agentdiet-dev-deterministic-llm-json-repair-schema-8c23dcfa"}