{"uid":"cap_xs_YeQHRqK_frOUzyJY5f","slug":"mcp-compiler-agentdiet-dev-deterministic-a2a-broken-json-repair-38617079","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-compiler.agentdiet.dev/v1/json-fix)","url":"https://mcp-compiler.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_9lJr8pAmz9zrG3RPBb1dL","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-compiler.agentdiet.dev","brandSlug":"mcp-compiler-agentdiet-dev-mpp","brandBaseUrl":"https://mcp-compiler.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 don't crash.","exampleAgentPrompt":"This LLM output came back as broken JSON with trailing commas and markdown fences — can you fix it so I can parse it? Here's the raw string: ```{\"name\": \"Alice\", \"age\": 30,}```","exampleUseCases":[{"title":"Fix LLM pipeline JSON crash","prompt":"My agent pipeline keeps crashing because the LLM is returning JSON with trailing commas. Can you repair this string so it parses correctly: '{\"status\": \"ok\", \"items\": [1, 2, 3,]}'?"},{"title":"Strip markdown fences from model output","prompt":"The model returned its JSON wrapped in triple backticks and it's breaking my parser. Can you clean this up and give me valid JSON: ```json\n{\"result\": \"success\", \"data\": null}\n```?"},{"title":"Recover truncated JSON from cut-off response","prompt":"The API response got cut off mid-JSON and now it won't parse. Can you repair this truncated output and return a valid JSON object: '{\"user\": {\"id\": 42, \"name\": \"Bob\"'?"}],"resultDescription":"A JSON object containing the repaired, valid JSON string reconstructed from the malformed input, with common issues like trailing commas, markdown code fences, single quotes, and truncation resolved deterministically.","failureModes":["Input JSON too severely corrupted to deterministically repair — returns error indicating unparseable input","Empty or whitespace-only raw_json input — returns validation error for missing required field","Input that is not JSON-like at all (plain text, binary) — may return error or best-effort result","Payment required (HTTP 402) if x402 USDC micropayment is not included"],"whenToPreferThis":"Choose this endpoint when an LLM or agent has produced malformed JSON that needs deterministic, rule-based repair before being parsed downstream — especially when dealing with trailing commas, markdown fences, or single-quoted keys. Prefer this over writing custom regex sanitizers or relying on LLM self-correction, which is non-deterministic. Best suited for multi-agent pipelines where JSON parsing failures are a recurring failure mode.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:26:08.687Z","isFirstParty":false,"canonicalSlug":"mcp-compiler-agentdiet-dev-deterministic-a2a-broken-json-repair-987bc021"}