{"uid":"cap_6ppNlz7uA56suSHJaeCP2","slug":"workflows-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-3628d82f","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://workflows.agentdiet.dev/v1/repair)","url":"https://workflows.agentdiet.dev/v1/repair?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_cRBnf_a0lGFxrd4ehhtaP","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"workflows.agentdiet.dev","brandSlug":"workflows-agentdiet-dev-mpp","brandBaseUrl":"https://workflows.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":"The LLM just returned this broken JSON with trailing commas and a markdown code fence — can you fix it so I can pass it to the next step: ```json {\"name\": \"Alice\", \"age\": 30,} ```","exampleUseCases":[{"title":"Fix LLM output in agent pipeline","prompt":"My language model returned this JSON but it has trailing commas and won't parse — can you repair it so the next agent in the chain can use it: {\"items\": [\"apple\", \"banana\",], \"count\": 2,}"},{"title":"Strip markdown fences from AI response","prompt":"The AI wrapped its JSON in triple backticks and my code is crashing — please clean this up and give me valid JSON: ```json {\"status\": 'active', \"score\": 0.95} ```"},{"title":"Recover truncated JSON from cutoff response","prompt":"My model hit its token limit mid-response and the JSON got cut off halfway through — here's what I got: {\"user\": {\"id\": 42, \"name\": \"Bob\", \"roles\": [\"admin\" — can you repair it into valid JSON?"}],"resultDescription":"A JSON object containing the repaired, valid JSON — with trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and any truncation-induced syntax errors deterministically fixed, ready for downstream parsing.","failureModes":["Input so severely truncated that structure cannot be inferred — returns error or best-effort partial repair","Non-JSON input (e.g. plain text, binary) — may return error indicating input is not repairable JSON","Ambiguous structure where multiple valid repairs are possible — may return only one deterministic interpretation","Network or payment-related failures (x402 payment required) — returns 402 status"],"whenToPreferThis":"Choose this endpoint when an AI agent pipeline receives unparseable JSON from an LLM — especially outputs with trailing commas, single-quoted keys/values, markdown code fences, or mid-sequence truncation. Prefer this over custom regex heuristics when you need deterministic, reliable repair across a wide range of malformation types without writing fragile parsing code.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T12:43:54.055Z","isFirstParty":false,"canonicalSlug":"workflows-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-ded1fe6a"}