{"uid":"cap_f75b2pkxXyHiN-f_TCfD3","slug":"mcp-security-agentdiet-dev-deterministic-a2a-broken-json-repair-c7927014","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-fix)","url":"https://mcp-security.agentdiet.dev/v1/json-fix?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_zTVzT98s4kyF1-l2CjDz4","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 LLM JSON outputs into valid JSON so multi-agent pipelines don't crash","exampleAgentPrompt":"This LLM response came back with broken JSON — it has trailing commas, markdown backticks around it, and got cut off mid-object. Can you fix it so I can parse it? Here's the raw string: ```{\"name\": \"Alice\", \"age\": 30, \"tags\": [\"dev\", \"ai\",}```","exampleUseCases":[{"title":"Fix LLM pipeline JSON crashes","prompt":"My agent pipeline keeps crashing because the LLM keeps returning JSON with trailing commas and markdown fences — can you repair this output so I can safely pass it to the next step? Here it is: ```{\"status\": \"ok\", \"results\": [\"a\", \"b\",]}```"},{"title":"Recover truncated JSON generation","prompt":"The model generated this JSON but it got cut off before finishing — can you repair it into valid JSON? The raw string is: {\"user\": \"bob\", \"score\": 42, \"meta\": {\"tags\": [\"premium\""},{"title":"Sanitize single-quoted JSON from scraper","prompt":"I scraped some data and the JSON came back using single quotes instead of double quotes and it won't parse — fix this string into valid JSON: {'product': 'Widget', 'price': 9.99, 'available': True}"}],"resultDescription":"Returns a JSON object containing the repaired, syntactically valid JSON parsed from the malformed input string, with common issues like trailing commas, markdown code fences, single quotes, and truncation corrected deterministically.","failureModes":["Input JSON is so severely malformed that deterministic repair is impossible — returns error","Input string is completely empty or whitespace — validation fails","JSON structure is ambiguous after truncation and cannot be reliably completed — partial repair or error returned","Payment not fulfilled (HTTP 402) — request blocked until x402 micropayment is settled"],"whenToPreferThis":"Choose this endpoint when your multi-agent pipeline receives raw LLM-generated JSON that may be truncated, contain trailing commas, markdown fences, or single quotes, and you need a deterministic (not AI-based) repair that is fast, cheap ($0.002/call), and safe to run in a hot path without risking hallucinated data. Prefer it over writing custom regex sanitizers or re-prompting the LLM, which wastes tokens and latency.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:21:45.309Z","isFirstParty":false,"canonicalSlug":"mcp-security-agentdiet-dev-deterministic-a2a-broken-json-repair-fe1334e3"}