{"uid":"cap_XxBVOd_quTRORjZsQ9i91","slug":"mcp-security-agentdiet-dev-deterministic-a2a-broken-json-repair-95fa5ee5","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/repair)","url":"https://mcp-security.agentdiet.dev/v1/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_zqJqgfQWYlx5tJvOJK1qB","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) into valid JSON so multi-agent pipelines never crash","exampleAgentPrompt":"This JSON came out of my LLM pipeline and it's broken — it has trailing commas, single quotes, and markdown fences. Can you repair it into valid JSON? Here it is: ```{\"name\": 'Alice', \"items\": [1, 2, 3,], ```","exampleUseCases":[{"title":"Fix LLM agent output before downstream processing","prompt":"My AI agent just returned this malformed JSON with trailing commas and markdown code fences wrapping it — can you repair it into clean valid JSON so I can pass it to the next step? Here's the raw output: ```json\n{\"status\": 'ok', \"results\": [\"a\", \"b\",]}\n```"},{"title":"Rescue truncated JSON from a token-limited response","prompt":"The model hit its token limit mid-response and I got this truncated JSON — can you repair it and close it properly so it's valid? Raw string: {\"user\": \"bob\", \"scores\": [98, 87, 76"},{"title":"Sanitize single-quoted JSON from a legacy pipeline","prompt":"I'm getting JSON with single quotes instead of double quotes from an old pipeline step and it's breaking my parser — can you convert and fix this into proper valid JSON? Here's what I have: {'product': 'widget', 'price': 9.99, 'tags': ['sale', 'new',]}"}],"resultDescription":"Returns a repaired, valid JSON object that has been cleaned of common LLM output artifacts including trailing commas, markdown code fences, single quotes, and truncation issues — ready to be parsed by standard JSON libraries without errors.","failureModes":["Input JSON is so severely malformed that deterministic repair is impossible — returns an error or partial result","Input string is not JSON at all (e.g. plain text or HTML) — repair will fail or return unexpected output","Extremely long truncated JSON may not be recoverable if structural context is lost","Payment failure via x402 protocol results in 402 response and no repair performed"],"whenToPreferThis":"Choose this endpoint when your multi-agent pipeline receives malformed, truncated, or non-standard JSON from LLM outputs and you need a deterministic (not AI-based) repair that is fast, cheap, and reliable. Prefer it over asking another LLM to fix the JSON, since LLM-based repair is non-deterministic and can introduce hallucinations. Ideal for production pipelines where consistent, rule-based JSON sanitization is critical.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:25:40.240Z","isFirstParty":false,"canonicalSlug":"mcp-security-agentdiet-dev-deterministic-a2a-broken-json-repair-fe1334e3"}