{"uid":"cap_WGyQGGPXFwoPvKoEwOdoq","slug":"serp-extract-agentdiet-dev-deterministic-a2a-broken-json-repair-6e5dc902","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/repair)","url":"https://serp-extract.agentdiet.dev/v1/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_NB4I4qrS9ZW42xf63McI2","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 LLM output is broken JSON — it has trailing commas, single quotes, and a markdown code fence wrapping it. Can you repair it so I can use it in my pipeline? Here it is: ```{name: 'Alice', age: 30,}```","exampleUseCases":[{"title":"Fix crashed agent pipeline JSON","prompt":"My agent just returned this malformed JSON with a trailing comma and single quotes and my pipeline keeps crashing — can you repair it so it's valid? Here's the raw output: {\"user\": 'bob', \"score\": 42,}"},{"title":"Strip markdown fences from LLM output","prompt":"The model wrapped its JSON in triple backtick markdown fences and my parser is choking on it. Can you clean it up and give me valid JSON? The raw string is: ```json\n{\"status\": \"ok\", \"items\": [1, 2, 3]}\n```"},{"title":"Recover truncated JSON response","prompt":"My LLM hit its token limit and the JSON got cut off mid-structure — can you try to repair and complete it so I get a valid object? Here's what I got: {\"results\": [{\"id\": 1, \"name\": \"foo\"}, {\"id\": 2"}],"resultDescription":"Returns a repaired, valid JSON object parsed from the malformed input. The response contains the corrected JSON structure with all syntax errors resolved — trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncated structures closed where possible.","failureModes":["Input is so severely truncated that deterministic repair is impossible — returns error or best-effort partial object","Input is not JSON at all (e.g. plain text prose) — repair fails or returns unexpected structure","Extremely nested or deeply malformed JSON may exceed repair heuristics — partial repair returned","Empty raw_json parameter — returns validation error","Ambiguous truncation points may result in incorrect field inference"],"whenToPreferThis":"Choose this endpoint when your multi-agent or LLM pipeline receives JSON that fails standard JSON.parse() due to common LLM output artifacts: trailing commas, single quotes, markdown code fences, or token-limit truncation. Prefer this over manual regex fixes or custom parsers when you need a deterministic, reliable repair step that works across all these failure modes in one call. Ideal for agentic workflows where downstream steps depend on structured data and any JSON parse failure would halt execution.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:25:57.184Z","isFirstParty":false,"canonicalSlug":"serp-extract-agentdiet-dev-deterministic-a2a-broken-json-repair-6e5dc902"}