{"uid":"cap_FPQxbMJqUzrw0GPUPYb7b","slug":"mcp-security-agentdiet-dev-deterministic-a2a-broken-json-repair-fe1334e3","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-repair)","url":"https://mcp-security.agentdiet.dev/v1/json-repair?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_KkVpkeH7_V_mDEN8Ydv6T","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":"Deterministically repairs malformed, truncated, or markdown-wrapped JSON strings (trailing commas, single quotes, fences) so multi-agent pipelines never crash on bad LLM output.","exampleAgentPrompt":"This JSON came back from the LLM but it's broken — it has trailing commas and markdown fences around it. Can you repair it so I can parse it? Here's the raw string: ```{\"name\": \"Alice\", \"age\": 30,}```","exampleUseCases":[{"title":"Fix LLM output crashing agent pipeline","prompt":"My LLM just returned this JSON with trailing commas and single quotes and now my pipeline is crashing — can you repair it so it's valid? Here's the raw output: {'name': 'Bob', 'score': 42,}"},{"title":"Strip markdown fences from AI response","prompt":"The model wrapped its JSON response in triple backticks again and my parser can't handle it. Can you clean it up and give me valid JSON? The raw string is: ```json\n{\"status\": \"ok\", \"count\": 5}\n```"},{"title":"Recover truncated JSON from partial generation","prompt":"The LLM stopped mid-generation and I got a truncated JSON object. Can you repair it and fill in what's structurally needed to make it valid? Here's the broken fragment: {\"items\": [{\"id\": 1, \"name\": \"widget\""}],"resultDescription":"A repaired, valid JSON object reconstructed from the malformed input — with trailing commas removed, markdown fences stripped, single quotes normalized to double quotes, and truncated structures closed — ready for downstream parsing without errors.","failureModes":["Input is so corrupted that no deterministic repair is possible — returns error or best-effort partial object","Input string is empty or missing (raw_json not provided) — returns 400 validation error","JSON is semantically ambiguous after repair (e.g. missing values cannot be inferred) — may return null-padded or incomplete structure","Payment not included or insufficient — returns HTTP 402 payment required","Network timeout on the endpoint — no response"],"whenToPreferThis":"Choose this endpoint when your multi-agent pipeline receives raw LLM-generated JSON that may be malformed, truncated, or wrapped in markdown fences and you need a deterministic (non-AI) repair that won't hallucinate new fields. Prefer over regex heuristics or custom parsers when you want a single reliable API call that handles the full spectrum of common LLM JSON failures including trailing commas, single quotes, and incomplete structures.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:25:52.249Z","isFirstParty":false,"canonicalSlug":"mcp-security-agentdiet-dev-deterministic-a2a-broken-json-repair-fe1334e3"}