{"uid":"cap_W5YLMliQ2xIZYJPPJYEMl","slug":"mcp-security-agentdiet-dev-deterministic-a2a-broken-json-repair-e9076942","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://mcp-security.agentdiet.dev/v1/malformed-json-healer)","url":"https://mcp-security.agentdiet.dev/v1/malformed-json-healer?utm_source=zero.xyz","method":"GET","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_2uqQuJplf8Hk3A6NvpGrT","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"mcp-security.agentdiet.dev","brandSlug":"mcp-security-agentdiet-dev-mpp","brandBaseUrl":"https://mcp-security.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":"Fix this malformed JSON from my LLM — it has trailing commas and markdown fences wrapping it: ```{\"name\": \"Alice\", \"age\": 30,}```","exampleUseCases":[{"title":"LLM output pipeline repair","prompt":"My LLM just returned this JSON with trailing commas and it's crashing my pipeline — can you repair it so I can keep processing? Here's the broken string: {\"results\": [\"alpha\", \"beta\",], \"count\": 2,}"},{"title":"Markdown-fenced JSON cleanup","prompt":"The AI returned its response wrapped in markdown code fences like ```json ... ``` and my downstream parser can't handle it — strip the fences and fix any other JSON issues in this string: ```json\n{\"status\": 'ok', \"data\": null}\n```"},{"title":"Truncated agent response recovery","prompt":"My agent's JSON got cut off mid-response and now it's invalid — try to repair this truncated JSON so I can extract the data from it: {\"users\": [{\"id\": 1, \"name\": \"Bob\"}, {\"id\": 2, \"name\":"}],"resultDescription":"A repaired, syntactically valid JSON object derived from the malformed input. The response contains the corrected JSON with issues like trailing commas, markdown code fences, single-quoted strings, and truncated structures resolved, making it safe to parse in downstream agent pipelines.","failureModes":["Input is so severely truncated that meaningful repair is impossible — returns error or best-effort partial result","Input contains non-JSON content entirely unrelated to JSON structure — may return error","Extremely large malformed strings may hit query parameter size limits since raw_json is passed as a GET query parameter","Ambiguous repair cases where multiple valid JSON interpretations exist may produce unexpected output"],"whenToPreferThis":"Choose this endpoint when your multi-agent pipeline receives LLM-generated JSON that fails standard JSON.parse due to common LLM formatting errors — trailing commas, markdown fences, single quotes, or truncation. It is purpose-built for deterministic repair of AI output artifacts rather than general-purpose JSON linting. Prefer it over manual regex fixes or client-side libraries when you need a reliable, hosted, pay-per-call solution in an agentic workflow that must handle malformed outputs gracefully without crashing.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:24:37.032Z","isFirstParty":false,"canonicalSlug":"mcp-security-agentdiet-dev-deterministic-a2a-broken-json-repair-fe1334e3"}