{"uid":"cap_g9_8p3F-KmPNv9iaqgTOf","slug":"serp-extract-agentdiet-dev-deterministic-a2a-broken-json-repair-bd265ee5","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":"GET","headers":{},"bodySchema":{"type":"object","required":["raw_json"],"properties":{"limit":{"type":"integer","default":20,"maximum":100,"minimum":1,"description":"Maximum number of items to return per page (1-100)"},"cursor":{"type":"string","description":"Opaque pagination cursor for fetching the next page"},"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_G1d090Zr1uUnlxxIWGhSV","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 JSON strings (trailing commas, markdown fences, single quotes) produced by LLMs so multi-agent pipelines can process them without crashing.","exampleAgentPrompt":"This JSON from the LLM came back broken — it has trailing commas, markdown code fences, and single quotes everywhere, and my pipeline keeps crashing. Can you deterministically repair it and give me valid JSON back? Here's the raw string: ```{'name': 'Alice', 'age': 30,}```","exampleUseCases":[{"title":"Fixing LLM output in agent pipeline","prompt":"The AI just returned this malformed JSON with a trailing comma and markdown fences and my downstream agent is crashing — can you repair it so I get clean valid JSON? Here it is: ```{\"results\": [\"foo\", \"bar\",]}```"},{"title":"Sanitizing single-quoted JSON before storage","prompt":"I've got a JSON blob from a language model that uses single quotes instead of double quotes and I need it fixed before I write it to the database — please repair this string: {'user': 'bob', 'score': 42}"},{"title":"Recovering truncated JSON from streamed response","prompt":"The streaming API cut off mid-response and I ended up with a truncated JSON object that's missing its closing braces — can you repair this broken string and return a valid JSON object? Here's what I got: {\"status\": \"ok\", \"data\": [{\"id\": 1, \"value\": \"test\""}],"resultDescription":"A repaired, valid JSON object derived from the malformed input string, with all common LLM-introduced errors corrected including trailing commas removed, markdown code fences stripped, single quotes converted to double quotes, and truncated structures closed.","failureModes":["Input JSON is so severely malformed that deterministic repair is impossible — returns error or partial result","Input string is not JSON at all (plain text, HTML, binary) — may return an error response","Ambiguous truncation points where multiple valid completions exist — repair may be semantically incorrect","Very long JSON strings may time out or exceed query parameter length limits via GET method","Nested or deeply escaped JSON strings may confuse the parser"],"whenToPreferThis":"Choose this endpoint when you need a fast, deterministic (non-AI) repair of LLM-generated JSON in a multi-agent or automation pipeline, especially when you cannot afford non-deterministic behavior or extra latency from a second LLM call. Prefer it over regex hacks or custom parsers when dealing with common LLM failure modes like trailing commas, markdown fences, and single quotes at scale.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:24:17.518Z","isFirstParty":false,"canonicalSlug":"serp-extract-agentdiet-dev-deterministic-a2a-broken-json-repair-6e5dc902"}