{"uid":"cap_IrkQG45hCtSjNBbyIR1vW","slug":"preflight-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-b87f27d6","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-fix)","url":"https://preflight.agentdiet.dev/v1/json-fix?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_uNB9Btq2bEx0tDtZ9Gq5M","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, malformed, or markdown-wrapped JSON strings (trailing commas, single quotes, fences) so multi-agent pipelines receive valid, parseable JSON.","exampleAgentPrompt":"This JSON from my LLM has trailing commas, single quotes, and a markdown code fence around it — can you fix it so it's valid and parseable: ```{'name': 'Alice', 'age': 30,}```?","exampleUseCases":[{"title":"Fix crashing multi-agent pipeline JSON","prompt":"My orchestrator agent keeps crashing because the sub-agent returns JSON with trailing commas and markdown fences — can you repair this output so it's valid JSON I can parse: ```{\"items\": [\"a\", \"b\",], \"count\": 2,}```?"},{"title":"Clean up single-quoted LLM response","prompt":"The LLM returned JSON using single quotes instead of double quotes and it's breaking my parser — fix this for me: {'user': 'bob', 'active': true, 'score': 42}"},{"title":"Repair truncated JSON from token limit","prompt":"My LLM hit its token limit and returned a cut-off JSON string that ends mid-object — can you repair it and give me back something valid to work with: {\"results\": [{\"id\": 1, \"name\": \"foo\"}, {\"id\": 2, \"name\":"}],"resultDescription":"Returns a JSON object containing the repaired, syntactically valid JSON string derived from the malformed input. The output should be parseable by any standard JSON parser, with issues like trailing commas, markdown fences, single quotes, and truncation corrected deterministically.","failureModes":["Input is so severely malformed or truncated that deterministic repair is impossible — returns an error or best-effort partial result","Input JSON is actually valid but contains semantic errors — endpoint fixes syntax only, not logic","Very large JSON payloads may hit query string length limits since raw_json is passed as a GET query parameter","Non-JSON input (e.g. plain text, binary) may produce unexpected repair attempts or errors","Payment failure via x402 protocol results in 402 response before any repair is attempted"],"whenToPreferThis":"Choose this endpoint when an AI agent or multi-agent pipeline receives LLM-generated JSON that fails to parse due to common syntax issues like trailing commas, single quotes, markdown code fences, or truncation. It is specifically designed for agentic workflows where downstream JSON parsing failures would crash the pipeline. Prefer it over manual string manipulation or regex hacks when you need deterministic, reliable JSON repair as a microservice. It is not suitable for semantic validation, schema enforcement beyond basic repair, or fixing deeply corrupted non-JSON content.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:23:04.415Z","isFirstParty":false,"canonicalSlug":"preflight-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-1d25665d"}