{"uid":"cap_W1b0mJ-QgHQVYaKlT2VPa","slug":"mcp-compiler-agentdiet-dev-deterministic-a2a-broken-json-repair-bf8815bf","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/structured-output)","url":"https://mcp-compiler.agentdiet.dev/v1/structured-output?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_01qBhMXTCq1oh4ANdPJUb","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, malformed, or markdown-wrapped LLM JSON outputs so multi-agent pipelines can continue without crashing.","exampleAgentPrompt":"My LLM just returned this broken JSON with trailing commas and markdown fences — can you repair it and give me a valid JSON object I can actually parse? Here's the raw output: ```json {\"name\": \"Alice\", \"age\": 30,} ```","exampleUseCases":[{"title":"Fixing LLM output in agent pipeline","prompt":"The AI model in my pipeline returned this malformed JSON with a trailing comma and I need it fixed before I pass it to the next step: {\"status\": \"ok\", \"result\": \"done\",}"},{"title":"Stripping markdown fences from structured output","prompt":"My language model wrapped its JSON response in triple backticks and now my parser crashes — can you clean this up and return valid JSON? Here's what it returned: ```json {\"user\": \"bob\", \"score\": 42} ```"},{"title":"Recovering truncated JSON from crashed agent","prompt":"One of my agents got cut off mid-response and returned incomplete JSON like {\"items\": [\"apple\", \"banana\" — can you repair this so I can extract the data?"}],"resultDescription":"A repaired, valid JSON object that has been sanitized of common LLM formatting issues including trailing commas, markdown fences, single quotes, and truncation artifacts — ready for downstream parsing and processing.","failureModes":["JSON is too severely malformed to repair deterministically — returns an error or best-effort partial object","Input string is not JSON-like at all — may return an error indicating unparseable input","Truncated JSON where the missing content cannot be inferred — may return incomplete repaired object","Network or payment failure — HTTP 402 if payment credentials are missing or invalid"],"whenToPreferThis":"Choose this endpoint when you need a deterministic, rule-based JSON repair rather than an LLM-based reformatter — ideal for production multi-agent pipelines where consistency and predictability matter. Best when the malformation is structural (trailing commas, markdown wrappers, single quotes, truncation) rather than semantic corruption. Prefer this over ad-hoc prompt engineering to fix JSON, as it guarantees a uniform repair strategy without consuming additional LLM tokens.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T12:40:41.983Z","isFirstParty":false,"canonicalSlug":"mcp-compiler-agentdiet-dev-deterministic-a2a-broken-json-repair-987bc021"}