{"uid":"cap_qlKOIeVpdyHibTmi0NdZ3","slug":"serp-extract-agentdiet-dev-deterministic-a2a-broken-json-repair-d1083d3b","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/schema-repair)","url":"https://serp-extract.agentdiet.dev/v1/schema-repair?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_ccpvUFqLtnlAz9ZoVXxoH","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, markdown code fences, and single quotes — can you repair it into valid JSON so the pipeline doesn't crash? Here's the raw output: ```json {'name': 'Alice', 'age': 30, }```","exampleUseCases":[{"title":"Fix crashed multi-agent pipeline output","prompt":"The previous agent returned this JSON but it's malformed with trailing commas and backtick fences — repair it into valid JSON so the next step in the workflow can process it: ```json {\"items\": [\"apple\", \"banana\",], \"count\": 2,}```"},{"title":"Sanitize LLM tool-call response","prompt":"My LLM returned a tool-call response with single quotes instead of double quotes and a missing closing bracket — please fix it into proper JSON: {'tool': 'search', 'query': 'latest news'"},{"title":"Validate and clean structured extraction output","prompt":"I ran a data extraction prompt and got back this half-truncated JSON blob — can you repair whatever's broken and give me valid, parseable JSON? Here it is: {\"company\": \"Acme Corp\", \"revenue\": \"$5M\", \"employees\":"}],"resultDescription":"A repaired, valid JSON object with all common LLM output defects corrected — trailing commas removed, markdown fences stripped, single quotes normalized to double quotes, truncated structures closed, and the result returned as a parseable JSON object ready for downstream agent consumption.","failureModes":["Input JSON is so severely malformed that deterministic repair is impossible — returns error indicating unrecoverable structure","Empty or whitespace-only raw_json input — returns validation error for minLength constraint","Input is not JSON at all (e.g. plain prose) — repair may fail or return unexpected output","Payment failure via x402 — returns HTTP 402 before processing","Network timeout for very large JSON strings"],"whenToPreferThis":"Choose this endpoint when your multi-agent pipeline receives JSON from LLMs that frequently produce trailing commas, markdown code fences (```json blocks), single-quoted keys, or truncated structures, and you need a deterministic (non-LLM) repair pass to prevent downstream crashes. Prefer it over asking another LLM to fix JSON, since deterministic repair is faster, cheaper, and more reliable for structural defects. Best suited for automated pipelines where JSON quality cannot be guaranteed at the source.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-23T06:30:52.666Z","isFirstParty":false,"canonicalSlug":"serp-extract-agentdiet-dev-deterministic-a2a-broken-json-repair-6e5dc902"}