{"uid":"cap_DQofRnwQ6ynpnfH8OxWFF","slug":"mcp-security-agentdiet-dev-deterministic-a2a-broken-json-repair-1f9e9637","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/llm-json-schema-healer)","url":"https://mcp-security.agentdiet.dev/v1/llm-json-schema-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_owxOZvnJBskDxm4X87QJT","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":"My LLM just returned this broken JSON with trailing commas and markdown fences — can you repair it so the pipeline doesn't crash? Here's the raw output: ```{\"name\": \"Alice\", \"score\": 42,}```","exampleUseCases":[{"title":"Fix LLM output in agent pipeline","prompt":"The language model in my pipeline returned malformed JSON with a trailing comma and it's crashing my downstream step — please repair this: {\"status\": \"ok\", \"items\": [\"a\", \"b\",]}"},{"title":"Strip markdown fences from JSON response","prompt":"My LLM wrapped its JSON output in markdown code fences and now I can't parse it — clean this up for me: ```json\n{\"user\": \"bob\", \"active\": true}\n```"},{"title":"Recover truncated JSON from long-context LLM","prompt":"My LLM got cut off mid-response and returned incomplete JSON that's missing closing braces — can you deterministically repair it so I can continue processing? Here it is: {\"report\": {\"title\": \"Q3 Summary\", \"data\": [1, 2, 3"}],"resultDescription":"A repaired, valid JSON object that has been cleaned of common LLM output artifacts such as trailing commas, markdown fences, single quotes, and truncation issues — ready for downstream parsing and processing in agent pipelines.","failureModes":["JSON is so severely malformed that deterministic repair is impossible","Input string is not JSON at all (plain text, HTML, etc.)","Truncation is too severe to infer missing structure","Schema mismatch if the repaired JSON doesn't match an expected schema","Empty or whitespace-only input returns an error"],"whenToPreferThis":"Choose this endpoint when your multi-agent pipeline receives JSON from an LLM that fails standard JSON.parse() due to common LLM artifacts (trailing commas, markdown fences, single quotes, or truncation). Prefer this over generic JSON parsers when you need deterministic, rule-based repair rather than probabilistic reconstruction, and when your pipeline demands reliability without crashes.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T12:39:36.241Z","isFirstParty":false,"canonicalSlug":"mcp-security-agentdiet-dev-deterministic-a2a-broken-json-repair-fe1334e3"}