{"uid":"cap_4mlEnotALXiixCy6yh9C9","slug":"hn-pulse-agentdiet-dev-deterministic-llm-json-repair-schema-validator-6ef66bff","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://hn-pulse.agentdiet.dev/v1/llm-json-schema-healer)","url":"https://hn-pulse.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_g6z9ksleNujO6eVw97xWn","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"hn-pulse.agentdiet.dev","brandSlug":"hn-pulse-agentdiet-dev-mpp","brandBaseUrl":"https://hn-pulse.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Repairs truncated, malformed, or markdown-wrapped JSON from LLM outputs so multi-agent pipelines can safely parse and continue processing.","exampleAgentPrompt":"This JSON from our LLM is broken — it has trailing commas, markdown fences, and single quotes — can you repair it so it parses correctly: ```{\"name\": 'Alice', \"items\": [1, 2, 3,],```","exampleUseCases":[{"title":"Fixing crashed multi-agent pipeline JSON","prompt":"Our agent pipeline keeps crashing because the upstream LLM is returning JSON with trailing commas and markdown code fences — can you repair this output so it parses cleanly: ```json\n{\"status\": 'ok', \"results\": [42, 17,],```"},{"title":"Sanitizing single-quoted LLM responses","prompt":"The model returned this JSON using single quotes instead of double quotes and it's breaking our downstream parser — please fix it: {'user': 'bob', 'score': 98, 'tags': ['ai', 'ml',]}"},{"title":"Recovering truncated JSON from long LLM output","prompt":"We got a truncated JSON response from our LLM — it got cut off mid-string and is missing closing brackets. Can you deterministically repair it so we can extract the data: {\"report\": {\"summary\": \"Q3 revenue grew significantly\", \"items\": [{\"id\": 1, \"val\": \"foo\""}],"resultDescription":"Returns a repaired, well-formed JSON object that has had common LLM-output errors corrected, including trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncated structures closed. The response is schema-compliant and ready for downstream parsing.","failureModes":["JSON is too severely malformed to deterministically repair — returns error indicating unrecoverable structure","Input is not JSON at all (e.g. plain text or HTML) — may return parse error","Ambiguous truncation with multiple valid completions — deterministic repair may choose an unexpected completion","Empty or whitespace-only raw_json input — returns validation error","Extremely long JSON strings may time out or exceed input limits"],"whenToPreferThis":"Choose this endpoint when your multi-agent pipeline receives LLM-generated JSON that fails to parse due to common formatting errors like trailing commas, markdown code fences, single quotes, or truncation. It is especially useful as a middleware repair step between LLM output and downstream JSON consumers, where deterministic (non-generative) repair is preferred over re-prompting the LLM. Prefer this over manual string cleaning when you need a reliable, low-latency, pay-per-call solution at $0.002 per repair.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:25:39.341Z","isFirstParty":false,"canonicalSlug":"hn-pulse-agentdiet-dev-deterministic-llm-json-repair-schema-validator-6ef66bff"}