{"uid":"cap_VFEfJ6M1ex_u8Vx1irwbK","slug":"serp-extract-agentdiet-dev-deterministic-a2a-broken-json-repair-12a63c5c","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/llm-json-schema-healer)","url":"https://serp-extract.agentdiet.dev/v1/llm-json-schema-healer?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_mlAhskxTVsxQgOyRsYf6I","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, malformed, or markdown-wrapped JSON strings from LLM outputs so multi-agent pipelines can continue without crashing.","exampleAgentPrompt":"This JSON string came back from an LLM and it's broken — it has trailing commas, markdown fences, and single quotes — can you repair it into valid JSON so my pipeline doesn't crash? Here it is: ```json {'name': 'Alice', 'age': 30,}```","exampleUseCases":[{"title":"Fixing LLM output in agent pipeline","prompt":"My AI agent returned a JSON blob with trailing commas and backtick fences and now my downstream tool is throwing a parse error — can you repair this JSON so I can keep processing? Here's the broken string: ```json {'user': 'Bob', 'score': 95,}```"},{"title":"Cleaning single-quoted JSON from GPT","prompt":"ChatGPT gave me JSON using single quotes instead of double quotes and my code won't parse it — please fix this into valid JSON: {'items': ['apple', 'banana'], 'count': 2,}"},{"title":"Recovering truncated JSON from LLM stream","prompt":"I got a truncated JSON response from a streaming LLM call and it cut off mid-object — can you repair it and return valid JSON? Here's what I received: {\"order\": {\"id\": 42, \"status\": \"pending\", \"items\": [\"widget\""}],"resultDescription":"A JSON object containing the repaired, valid JSON — free of trailing commas, markdown fences, single quotes, or truncation artifacts — that can be safely parsed and passed downstream in multi-agent pipelines.","failureModes":["Input JSON is so severely malformed it cannot be deterministically repaired — returns error indicating unrecoverable structure","Input is not JSON-like at all (e.g. plain prose) — may return validation error","Extremely large or deeply nested JSON may exceed processing limits","Network or payment (x402) failure returns HTTP 402 or 5xx with error message"],"whenToPreferThis":"Choose this endpoint when your agent pipeline receives LLM-generated JSON that fails to parse due to common formatting issues like trailing commas, single quotes, markdown code fences, or truncation. It is deterministic (no LLM re-generation), idempotent, and fast — making it ideal as a lightweight middleware step between LLM output and downstream JSON consumers. Prefer this over asking the LLM to regenerate the JSON, which is slower, non-deterministic, and costs more tokens.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-23T06:34:36.745Z","isFirstParty":false,"canonicalSlug":"serp-extract-agentdiet-dev-deterministic-a2a-broken-json-repair-6e5dc902"}