{"uid":"cap_205XlUc9qtWg9rvZS-14M","slug":"workflows-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-a6787da5","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/structured-output)","url":"https://workflows.agentdiet.dev/v1/structured-output?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_-27pbxqk3xohnQEVcMQU0","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":"This JSON string from my LLM has trailing commas and markdown fences and is crashing my pipeline — can you repair it and give me back clean, valid JSON? Here it is: ```{\"name\": \"Alice\", \"age\": 30,}```","exampleUseCases":[{"title":"Fix crashing multi-agent pipeline","prompt":"My agent pipeline keeps crashing because the upstream LLM is returning JSON with trailing commas and sometimes wrapped in markdown code fences. Can you clean up this broken output so it parses correctly: ```{\"status\": \"ok\", \"items\": [1, 2, 3,],}```?"},{"title":"Repair truncated LLM structured output","prompt":"The LLM cut off mid-response and I got a truncated JSON object that's missing its closing brackets. Can you deterministically repair this so I can keep processing: {\"user\": \"bob\", \"score\": 42, \"tags\": [\"a\", \"b\""},{"title":"Sanitize single-quoted JSON before database insert","prompt":"I have a JSON string that uses single quotes instead of double quotes coming from an LLM response — it's failing validation before I can insert it. Can you fix it to proper JSON? Here it is: {'product': 'widget', 'price': 9.99, 'available': true}"}],"resultDescription":"A repaired, valid JSON object with all syntax errors corrected — trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncated structures closed — ready for direct use in downstream agent pipelines.","failureModes":["JSON is so severely malformed it cannot be deterministically repaired — returns error","Input is not JSON at all (e.g. plain text or binary) — repair cannot be attempted","raw_json parameter missing or empty — returns 400 validation error","Payment not completed via x402 — returns 402 Payment Required"],"whenToPreferThis":"Choose this endpoint when your multi-agent pipeline receives LLM-generated JSON that fails standard parsing due to common issues like trailing commas, markdown code fences, single quotes, or truncation. It is deterministic (not generative), making it reliable for production pipelines where consistency matters. Prefer it over ad-hoc prompt engineering or regex hacks when you need a robust, paid, auditable repair step in an automated workflow.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:18:49.255Z","isFirstParty":false,"canonicalSlug":"workflows-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-ded1fe6a"}