{"uid":"cap_q6fpuaKQuBkCrM-Tz2Ydx","slug":"serp-extract-agentdiet-dev-deterministic-a2a-broken-json-repair-b8a93e51","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/json-fix)","url":"https://serp-extract.agentdiet.dev/v1/json-fix?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_wWtLtRDVTKJ_nMsT6O7qn","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 malformed, truncated, or markdown-wrapped LLM JSON outputs so multi-agent pipelines can process them without crashing","exampleAgentPrompt":"The LLM just returned this JSON with trailing commas and markdown code fences and it keeps breaking my pipeline — can you clean it up and give me valid parseable JSON? Here's the raw output: ```json {\"name\": \"Alice\", \"score\": 42, } ```","exampleUseCases":[{"title":"Fix LLM output in agentic pipeline","prompt":"My AI agent just returned this JSON response but it has single quotes instead of double quotes and a trailing comma — it's crashing my downstream parser. Can you repair it and return valid JSON? Here's the raw string: {'name': 'Bob', 'items': ['a', 'b',],}"},{"title":"Strip markdown fences from model output","prompt":"The model wrapped its JSON response in triple backtick markdown fences and added a language tag, so my code can't parse it. Can you strip that out and give me clean, valid JSON? Here's what it returned: ```json\n{\"status\": \"ok\", \"count\": 5}\n```"},{"title":"Recover truncated JSON from context window cutoff","prompt":"My LLM hit its token limit mid-response and the JSON got cut off — it's missing the closing brackets and braces. Can you repair and complete it into valid JSON? The truncated output is: {\"results\": [{\"id\": 1, \"title\": \"Alpha\"}, {\"id\": 2, \"title\": \"Beta\""}],"resultDescription":"A repaired, valid JSON object that has been cleaned of markdown fences, trailing commas, single quotes, truncation artifacts, and other common LLM output malformations — ready for downstream parsing and processing in agent pipelines.","failureModes":["JSON is too severely corrupted or ambiguous to deterministically repair without hallucinating structure","Input is not JSON at all (e.g. plain text prose) — repair not possible","Truncation is so severe that the original schema cannot be inferred, resulting in incomplete output","Missing or empty raw_json field returns a validation error","Extremely long JSON strings may time out or hit size limits"],"whenToPreferThis":"Choose this endpoint when your multi-agent or LLM pipeline receives JSON that fails to parse due to common LLM artifacts like trailing commas, markdown code fences, single quotes, or truncation. It is deterministic (no LLM rewriting), making it safe and predictable for production pipelines. Prefer it over prompt-engineering retries when you need a reliable, low-latency repair step that does not alter the semantic content of the JSON.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-23T06:31:28.443Z","isFirstParty":false,"canonicalSlug":"serp-extract-agentdiet-dev-deterministic-a2a-broken-json-repair-6e5dc902"}