{"uid":"cap_ZSWlgX3NK3ldauHAncsu0","slug":"mcp-security-agentdiet-dev-deterministic-a2a-broken-json-repair-ada24f2d","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/json-validator)","url":"https://mcp-security.agentdiet.dev/v1/json-validator?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_RmcTa7Aisg9wCEB_oy7CF","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, truncation) so multi-agent pipelines can continue without crashing.","exampleAgentPrompt":"This JSON string from the LLM is broken — it has trailing commas and markdown fences — can you repair it so I can use it? Here it is: ```{\"name\": \"Alice\", \"age\": 30,}```","exampleUseCases":[{"title":"Fix LLM pipeline JSON crash","prompt":"The JSON my LLM just returned has trailing commas and won't parse — can you fix it for me? Here's the raw output: {\"status\": \"ok\", \"items\": [\"a\", \"b\",]}"},{"title":"Strip markdown fences from agent output","prompt":"My coding agent wrapped its JSON response in triple-backtick markdown fences and now my pipeline is crashing. Can you clean this up and return proper JSON? Raw string: ```json\n{\"result\": true, \"count\": 5}\n```"},{"title":"Recover truncated JSON from LLM","prompt":"The LLM cut off mid-response and I got incomplete JSON — something like {\"user\": \"bob\", \"score\": 42, \"tags\": [\"x\" — can you repair it so it's valid and parseable?"}],"resultDescription":"A repaired, valid JSON object derived from the malformed input. The endpoint deterministically fixes issues like trailing commas, single quotes instead of double quotes, markdown code fence wrappers, and truncated structures, returning a clean JSON payload ready for downstream consumption.","failureModes":["Input JSON is so severely malformed that deterministic repair is impossible — returns error","Empty or null raw_json parameter — returns validation error","Input is not JSON at all (plain text, binary data) — may return error or unexpected output","Ambiguous truncation where the intended structure cannot be inferred — partial or incorrect repair"],"whenToPreferThis":"Choose this endpoint when your multi-agent pipeline receives LLM-generated JSON that fails standard JSON.parse() due to common LLM formatting issues (trailing commas, markdown fences, single quotes, truncation). It is purpose-built for AI pipeline robustness rather than general-purpose schema validation tools, and is ideal when you need a deterministic, lightweight fix rather than an LLM-based re-generation of the JSON.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:25:42.652Z","isFirstParty":false,"canonicalSlug":"mcp-security-agentdiet-dev-deterministic-a2a-broken-json-repair-fe1334e3"}