{"uid":"cap_o0a28pqb-CT0KZHxpjX4-","slug":"preflight-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-a9bb40de","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_XDmCl6KcWWuOd0hJ3fZsD","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 output from the LLM is broken — it has trailing commas and is wrapped in markdown fences — can you fix it so it parses correctly? Here's the raw string: ```{\"name\": \"Alice\", \"score\": 42,}```","exampleUseCases":[{"title":"LLM output repair in agent pipeline","prompt":"The last step in my pipeline returned broken JSON with a trailing comma and a markdown fence — here's the raw output: ```{\"status\": \"ok\", \"count\": 3,}``` — can you repair it so I can pass it to the next tool?"},{"title":"Single-quote JSON fix for downstream parsing","prompt":"My LLM returned JSON using single quotes instead of double quotes, like {'user': 'bob', 'active': true} — can you fix that into valid JSON so my code doesn't crash?"},{"title":"Truncated JSON recovery from long LLM context","prompt":"The model got cut off mid-response and gave me a truncated JSON object that's missing its closing brackets — here it is: {\"items\": [{\"id\": 1, \"name\": \"widget\" — can you repair and close it?"}],"resultDescription":"Returns a repaired, valid JSON object derived from the input malformed string, with common issues resolved including trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncated structures closed.","failureModes":["Input is so severely malformed that deterministic repair is not possible, returning an error or best-effort partial result","Input string is empty or whitespace only, triggering a validation error","JSON structure is ambiguous after repair (e.g. multiple valid completions for truncated input), result may not match original intent","Non-JSON content passed as input (e.g. plain text or binary data), causing repair failure"],"whenToPreferThis":"Choose this endpoint when you need deterministic, rule-based JSON repair rather than probabilistic LLM re-prompting. It is ideal for high-throughput multi-agent pipelines where LLM outputs frequently contain markdown fences, trailing commas, or single quotes and you cannot afford pipeline crashes. Prefer it over asking an LLM to re-generate clean JSON when latency and cost are a concern, or when you need reliable, reproducible repair behavior.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:22:44.527Z","isFirstParty":false,"canonicalSlug":"preflight-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-1d25665d"}