{"uid":"cap_2m4iYH4-ZmRb7ROuq2WnK","slug":"mcp-security-agentdiet-dev-deterministic-a2a-broken-json-repair-2b22c09c","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/schema-repair)","url":"https://mcp-security.agentdiet.dev/v1/schema-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_ZvewMdstw197e_tI_irq7","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 JSON string from the LLM is broken — it has trailing commas and markdown fences around it — can you repair it so it's valid JSON I can parse? Here's the raw output: ```{\"name\": \"Alice\", \"age\": 30,}```","exampleUseCases":[{"title":"Fix LLM output before pipeline step","prompt":"The language model returned this JSON with a trailing comma and it's crashing my next pipeline step — please repair it: {\"model\": \"gpt-4\", \"tokens\": 1200,}"},{"title":"Strip markdown fences from JSON response","prompt":"My agent got back a response wrapped in triple backtick markdown fences and my parser can't handle it — can you clean it up and return valid JSON? Here's what I got: ```json\n{\"status\": \"ok\", \"results\": []}\n```"},{"title":"Repair single-quoted JSON from scraper","prompt":"I scraped some structured data but it came back using single quotes instead of double quotes — can you fix this so it's valid JSON? The string is: {'user': 'bob', 'score': 42}"}],"resultDescription":"A JSON object containing the repaired, valid JSON derived from the malformed input, with syntax errors corrected — trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncated structures closed where possible.","failureModes":["Input is so severely malformed that deterministic repair is impossible — returns error indicating unrecoverable structure","Input is not JSON-like at all (plain text, binary data) — returns error or empty result","Extremely long truncated JSON may have ambiguous completion — repair may not match original intent","Missing required raw_json parameter returns a 400 or validation error"],"whenToPreferThis":"Choose this endpoint when your multi-agent pipeline receives LLM-generated JSON that fails standard JSON.parse() due to common issues like trailing commas, markdown code fences, single quotes, or truncation. Ideal for production agentic workflows where downstream steps require strict JSON validity and you need a deterministic (non-AI) fix rather than asking another LLM to rewrite the output. Prefer this over writing custom regex fixers or re-prompting the LLM when speed and reliability matter.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:21:29.407Z","isFirstParty":false,"canonicalSlug":"mcp-security-agentdiet-dev-deterministic-a2a-broken-json-repair-fe1334e3"}