{"uid":"cap_1ujLE7q5VMOyyAHpSdsxS","slug":"serp-extract-agentdiet-dev-deterministic-a2a-broken-json-repair-63fbbf9a","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-validator)","url":"https://serp-extract.agentdiet.dev/v1/json-validator?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_vV9EUqwI1AEq9i90TSNSo","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 from the LLM is broken — it has trailing commas and markdown code fences around it — can you repair it so it's valid and parseable: ```json {\"name\": \"Alice\", \"score\": 42,} ```","exampleUseCases":[{"title":"Fix LLM output in agent pipeline","prompt":"The JSON my AI model just returned has trailing commas and single quotes instead of double quotes — can you repair it so it parses correctly? Here it is: {name: 'Bob', tags: ['a', 'b',]}"},{"title":"Strip markdown fences from agent response","prompt":"My LLM wrapped its JSON in markdown code fences and it's crashing my parser — please fix this: ```json\n{\"status\": \"ok\", \"items\": [1, 2, 3,]}\n```"},{"title":"Recover truncated JSON from timeout","prompt":"My agent pipeline timed out and the JSON got cut off mid-string — can you repair this truncated output so it's valid JSON again: {\"results\": [{\"id\": 1, \"name\": \"foo\"}, {\"id\": 2"}],"resultDescription":"Returns a JSON object containing the repaired, well-formed JSON structure derived from the malformed input, suitable for downstream parsing and processing in agent pipelines.","failureModes":["Input is so severely malformed that deterministic repair is impossible and no valid JSON can be inferred","Input is empty or missing the raw_json parameter, returning a 400 error","Ambiguous structure makes repair produce semantically incorrect but syntactically valid JSON","Service unavailable or payment not processed, returning HTTP 402 or 5xx"],"whenToPreferThis":"Choose this endpoint when you need deterministic, rule-based JSON repair for LLM outputs in automated pipelines where reliability matters — especially when dealing with trailing commas, markdown code fences, or single-quote issues. Prefer this over ad-hoc regex or LLM-based repair when you need consistent, predictable behavior without additional token cost.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:22:45.020Z","isFirstParty":false,"canonicalSlug":"serp-extract-agentdiet-dev-deterministic-a2a-broken-json-repair-6e5dc902"}