{"uid":"cap_LWN4_IH9l_TALGgoNvH4A","slug":"preflight-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-f335747e","name":"Deterministic A2A Broken-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://preflight.agentdiet.dev/v1/json-normalizer)","url":"https://preflight.agentdiet.dev/v1/json-normalizer?utm_source=zero.xyz","method":"POST","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_jcBdvZrGQEV5l7urAJteX","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"preflight.agentdiet.dev","brandSlug":"preflight-agentdiet-dev-mpp","brandBaseUrl":"https://preflight.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Repairs truncated or malformed LLM JSON outputs (trailing commas, markdown fences, single quotes) so multi-agent pipelines never crash","exampleAgentPrompt":"This JSON string came back from an LLM and it won't parse — it has trailing commas and markdown fences around it. Can you run it through the JSON normalizer to fix it: ```{\"name\": \"Alice\", \"age\": 30,}```?","exampleUseCases":[{"title":"Fix LLM output in agentic pipeline","prompt":"The LLM in my pipeline returned this JSON with a trailing comma and it's crashing my parser — can you repair it so I can continue processing? Here it is: {\"status\": \"ok\", \"items\": [\"a\", \"b\",]}"},{"title":"Strip markdown fences from agent response","prompt":"My coding agent wrapped its JSON response in triple backtick markdown fences and now my downstream tool can't read it. Can you clean this up and give me valid JSON: ```json\n{\"result\": \"success\", \"count\": 42}\n```?"},{"title":"Repair single-quoted JSON from scraped data","prompt":"I've got a JSON-like string that uses single quotes instead of double quotes — it came from a web scraper — and I need it converted to valid JSON before I store it. Here it is: {'user': 'bob', 'score': 99}"}],"resultDescription":"A repaired, fully valid JSON object that has been normalized from the malformed input — with trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncations resolved where possible.","failureModes":["Input is so severely malformed that deterministic repair is impossible — returns error indicating unrecoverable JSON","Input string is empty or below minimum length — validation error","Payment not processed — HTTP 402 returned before repair is attempted","Network timeout if the service is temporarily unavailable","Ambiguous truncation points where repair would require guessing structure"],"whenToPreferThis":"Choose this endpoint when you need deterministic, rule-based JSON repair in a multi-agent or LLM pipeline — not a generative fix that might alter semantics. Ideal when LLM outputs consistently produce trailing commas, markdown fences, or single-quote artifacts that break downstream parsers. Prefer this over writing custom regex fixes when you need a reliable, pay-per-call microservice that handles the full range of common LLM JSON malformations without hallucinating new content.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-21T06:42:23.906Z","isFirstParty":false,"canonicalSlug":"preflight-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-1d25665d"}