{"uid":"cap_MrT_ru1RG8sZaUOp6Tte2","slug":"mcp-security-agentdiet-dev-deterministic-a2a-broken-json-repair-8ee6bd2b","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/structured-output)","url":"https://mcp-security.agentdiet.dev/v1/structured-output?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__ebOaCkXLM0qR96e8SUoG","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 malformed, truncated, or markdown-wrapped JSON strings from LLM outputs so multi-agent pipelines can process them without crashing.","exampleAgentPrompt":"This JSON from the LLM response is broken — it has trailing commas, single quotes, and a markdown code fence. Can you repair it so it's valid JSON I can actually parse: ```{'name': 'Alice', 'age': 30,}```?","exampleUseCases":[{"title":"LLM pipeline JSON crash prevention","prompt":"My language model keeps returning JSON with trailing commas and markdown fences that crash my downstream parser. Can you fix this raw output so it becomes valid, parseable JSON: ```json\n{\"user\": \"bob\", \"score\": 95,}\n```?"},{"title":"Multi-agent structured output recovery","prompt":"One of my agents returned a truncated JSON object that's missing the closing brace and has single quotes. I need this repaired into proper JSON before I can pass it to the next agent: {\"task\": 'summarize', \"status\": 'done'"},{"title":"LLM response sanitization before storage","prompt":"Before I write this AI-generated response to my database, can you clean up the JSON? It has a trailing comma, some single-quoted keys, and it's wrapped in a markdown code block that needs to be stripped out."}],"resultDescription":"A repaired, valid JSON object that has been cleaned of common LLM output artifacts including trailing commas, markdown code fences, single-quoted strings, and truncation issues — ready for immediate downstream consumption by agents or parsers.","failureModes":["Input JSON is too severely corrupted to deterministically repair — returns error or best-effort partial result","Input string is not JSON at all (e.g. plain prose) — may return error","Ambiguous repair paths where multiple valid interpretations exist — one is chosen deterministically but may not match intent","Empty or whitespace-only input — returns validation error"],"whenToPreferThis":"Choose this endpoint when your multi-agent pipeline receives JSON from LLMs that frequently produces malformed output (trailing commas, markdown wrapping, single quotes, truncation). It is purpose-built for the LLM-to-agent handoff problem and applies deterministic repair rules, making it predictable and safe for automated pipelines. Prefer it over custom regex hacks or general-purpose JSON parsers when you need reliable, consistent repair with an auditable per-call cost model.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-21T12:38:01.324Z","isFirstParty":false,"canonicalSlug":"mcp-security-agentdiet-dev-deterministic-a2a-broken-json-repair-fe1334e3"}