{"uid":"cap_e-qLvmlDPu_4ne6XV5jG2","slug":"serp-extract-agentdiet-dev-deterministic-a2a-broken-json-repair-187d7636","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://serp-extract.agentdiet.dev/v1/structured-output)","url":"https://serp-extract.agentdiet.dev/v1/structured-output?utm_source=zero.xyz","method":"POST","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_C-Lr70_TJdFozAvrsys6N","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"serp-extract.agentdiet.dev","brandSlug":"serp-extract-agentdiet-dev-mpp","brandBaseUrl":"https://serp-extract.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 came back from an LLM and it's broken — it has trailing commas, single quotes, and markdown fences — can you fix it so it parses correctly: ```{'name': 'Alice', 'age': 30,}```","exampleUseCases":[{"title":"Fix LLM output before database write","prompt":"The AI just returned this malformed JSON with trailing commas and markdown code fences — fix it so I can write it to the database without crashing: ```json\n{\"user\": \"bob\", \"score\": 42,}\n```"},{"title":"Recover crashed agent pipeline","prompt":"My multi-agent pipeline keeps failing because one of the LLM nodes is returning truncated JSON — here's the broken output, can you repair it deterministically so the next step doesn't blow up: {\"items\": [\"a\", \"b\""},{"title":"Sanitize single-quoted JSON from model","prompt":"The model returned JSON using single quotes instead of double quotes and my parser is rejecting it — please repair this so it's valid JSON: {'product': 'widget', 'price': 9.99, 'inStock': true}"}],"resultDescription":"A repaired, valid JSON object reconstructed from the malformed input. The response includes the fixed JSON with corrected syntax — trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncated structures closed — ready for downstream parsing without errors.","failureModes":["Input is so severely truncated it cannot be deterministically reconstructed — returns error indicating ambiguous repair","Input is not JSON at all (e.g. plain text or binary) — returns validation error","Empty raw_json string — rejected by minLength:1 schema constraint","Payment not included or invalid — HTTP 402 response requiring x402 USDC payment","Malformed input exceeds token limits or complexity thresholds — may return partial repair with warning"],"whenToPreferThis":"Choose this endpoint when your multi-agent pipeline receives LLM-generated JSON that fails to parse due to common formatting issues like trailing commas, markdown code fences, single quotes, or truncation. It is specifically designed for deterministic repair (not probabilistic re-generation), making it reliable for production pipelines where consistency matters. Prefer this over asking the LLM to retry when you need a fast, cheap, and predictable fix without burning additional tokens.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-23T06:37:14.403Z","isFirstParty":false,"canonicalSlug":"serp-extract-agentdiet-dev-deterministic-a2a-broken-json-repair-6e5dc902"}