{"uid":"cap_G9EkApxylSyeL3Jm3nOra","slug":"mcp-security-agentdiet-dev-deterministic-a2a-broken-json-repair-8b30af6e","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/repair)","url":"https://mcp-security.agentdiet.dev/v1/repair?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_u6Q7yXOaX92gUHu6nTrCl","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":"This JSON came back from the LLM with trailing commas and markdown fences wrapped around it — can you repair it so it parses cleanly? Here it is: ```{\"name\": \"Alice\", \"age\": 30,}```","exampleUseCases":[{"title":"Fixing LLM pipeline JSON crashes","prompt":"My agent just got this JSON back from the model and it keeps throwing a parse error — can you fix it? Here's the broken output: {\"items\": [\"apple\", \"banana\",], \"count\": 2,}"},{"title":"Stripping markdown fences from model output","prompt":"The LLM wrapped its JSON response in triple backticks and now my downstream code can't read it. Can you strip the fences and give me clean JSON? The raw output is: ```json\n{\"status\": \"ok\", \"value\": 42}\n```"},{"title":"Repairing single-quoted JSON from agent response","prompt":"I got this response from an agent that used single quotes instead of double quotes and it's not valid JSON — can you repair it so it's properly formatted? Here it is: {'user': 'bob', 'score': 99}"}],"resultDescription":"A parsed, valid JSON object that has been deterministically repaired from the malformed input — with trailing commas removed, markdown fences stripped, single quotes normalized to double quotes, and truncated structures closed where possible.","failureModes":["Input is so severely malformed that deterministic repair is impossible — returns an error indicating unrecoverable JSON","Input string is empty or null — returns a validation error","JSON is ambiguous or structurally contradictory and cannot be deterministically resolved — returns a partial repair with a warning","Network timeout or service unavailability — returns a 5xx error"],"whenToPreferThis":"Choose this endpoint when your multi-agent pipeline or LLM workflow receives JSON that fails standard JSON.parse() due to common LLM formatting mistakes like trailing commas, markdown code fences, single quotes, or truncation. It is deterministic (not probabilistic), making it reliable for production pipelines. Prefer it over writing custom regex repair logic or using a general-purpose LLM call to fix JSON, as it is cheaper, faster, and consistent.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-21T00:37:33.753Z","isFirstParty":false,"canonicalSlug":"mcp-security-agentdiet-dev-deterministic-a2a-broken-json-repair-fe1334e3"}