{"uid":"cap_fv-ovYMh0HZqbxg8aXj_B","slug":"preflight-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-8a121bff","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-validator)","url":"https://preflight.agentdiet.dev/v1/json-validator?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_ugTMOfyvIoEXuB-v9uB9J","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 came back from the LLM with trailing commas and markdown fences and it's breaking my pipeline — can you repair it and give me back valid JSON? Here's the raw output: ```json {\"name\": \"Alice\", \"age\": 30, } ```","exampleUseCases":[{"title":"Fix LLM JSON in agentic pipeline","prompt":"The model just returned this JSON with a trailing comma and it's crashing my parser — can you clean it up so I can pass it to the next step? Here's what I got: {\"status\": \"ok\", \"items\": [1, 2, 3,]}"},{"title":"Strip markdown fences from code block","prompt":"My LLM wrapped its JSON response in triple backtick markdown fences and now I can't parse it — can you strip the fences and give me back the raw valid JSON object?"},{"title":"Repair single-quoted JSON from agent output","prompt":"I have a JSON string that uses single quotes instead of double quotes and it's failing JSON.parse — can you fix it to standard JSON? Here it is: {'user': 'bob', 'active': true}"}],"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 — so the output is immediately parseable by downstream agents or code.","failureModes":["JSON too severely truncated to deterministically infer structure — returns error indicating unrecoverable input","Input is not JSON-like at all — returns validation error","Empty raw_json parameter — returns 400 bad request","JSON is already valid — returns it unchanged with no error"],"whenToPreferThis":"Choose this endpoint when an LLM or agent in your pipeline produces JSON that fails to parse due to common syntax issues like trailing commas, markdown code fences, single quotes, or truncation. It is deterministic rather than generative, making it reliable for production pipelines where you need consistent, predictable repair behavior without risking hallucinated field values.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:25:37.331Z","isFirstParty":false,"canonicalSlug":"preflight-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-1d25665d"}