{"uid":"cap_T8_awPvn-231SWMTmfNOf","slug":"mcp-security-agentdiet-dev-deterministic-a2a-broken-json-repair-535867df","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":"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_lgDtuH9664Ufeitk0XClF","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 LLM response came back with broken JSON — it has trailing commas, markdown code fences, and single quotes — can you repair it so my pipeline can parse it: ```{'name': 'Alice', 'age': 30,}```","exampleUseCases":[{"title":"Fixing LLM output in agent pipeline","prompt":"My LLM just returned a JSON object wrapped in markdown fences with trailing commas and it's breaking my downstream processing — can you repair this malformed string so I get clean parseable JSON: ```json\n{\"items\": [\"a\", \"b\",], \"count\": 2}\n```"},{"title":"Recovering truncated JSON from token limit","prompt":"The model hit its token limit mid-response and I got a truncated JSON like {\"user\": \"bob\", \"settings\": {\"theme\": \"dark\" — can you repair and close this so it's valid JSON I can actually use?"},{"title":"Sanitizing single-quoted agent output","prompt":"My agent returned JSON using single quotes instead of double quotes and it won't parse — fix this string so it's valid: {'status': 'ok', 'results': ['item1', 'item2']}"}],"resultDescription":"A repaired, schema-valid JSON object reconstructed from the malformed input — with markdown fences stripped, trailing commas removed, single quotes converted to double quotes, and truncated structures closed — ready for direct use in downstream parsing or agent logic.","failureModes":["Input is so severely malformed it cannot be deterministically repaired — returns error indicating irrecoverable JSON","Empty or whitespace-only raw_json input rejected with validation error","Input that is not JSON-like at all (e.g. plain prose) may fail to produce valid output","Network timeout or service unavailability returns 5xx error","Payment failure via x402 returns 402 response requiring USDC payment"],"whenToPreferThis":"Choose this endpoint when your multi-agent pipeline or LLM workflow receives malformed, truncated, or markdown-wrapped JSON that breaks downstream parsing — especially when you need deterministic, rule-based repair (not LLM re-generation) to fix common LLM output artifacts like trailing commas, single quotes, and unclosed structures. Prefer this over asking the LLM to retry when you need reliability, low latency, and cost-efficiency at $0.002 per call.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-21T12:38:33.111Z","isFirstParty":false,"canonicalSlug":"mcp-security-agentdiet-dev-deterministic-a2a-broken-json-repair-fe1334e3"}