{"uid":"cap_5ofCl7kflS56H8RaTbd1N","slug":"mcp-security-agentdiet-dev-deterministic-a2a-broken-json-repair-dd922c6a","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/malformed-json-healer)","url":"https://mcp-security.agentdiet.dev/v1/malformed-json-healer?utm_source=zero.xyz","method":"POST","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_384XzHeaeXX6ubbDGmwMq","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 came back from the LLM but it has trailing commas and is wrapped in markdown code fences — can you fix it so it's valid and parseable? Here it is: ```json {\"name\": \"Alice\", \"age\": 30,} ```","exampleUseCases":[{"title":"Fix LLM output in agent pipeline","prompt":"The JSON my agent just returned has trailing commas and single quotes instead of double quotes — it's breaking the next step in my pipeline. Can you repair it and give me back valid JSON?"},{"title":"Strip markdown fences from model response","prompt":"My language model keeps wrapping its JSON in triple-backtick markdown code blocks and I can't parse it downstream. Can you strip those out and return clean, valid JSON?"},{"title":"Recover truncated JSON from timeout","prompt":"The LLM response got cut off mid-JSON and now it's missing closing brackets. Can you deterministically complete and repair it so I can keep processing it?"}],"resultDescription":"A repaired, valid JSON object that has been cleaned of common LLM output issues including trailing commas, markdown fences, single quotes, and truncation artifacts — ready for downstream parsing and schema validation.","failureModes":["Input JSON is too severely corrupted to deterministically repair — returns error with description","Input is not JSON-like at all (plain text, HTML) — cannot infer structure","Ambiguous truncation with multiple valid completions — may return best-guess with confidence flag","Empty or whitespace-only input — returns validation error"],"whenToPreferThis":"Choose this endpoint when you need deterministic, rule-based JSON repair in a multi-agent or LLM pipeline where malformed outputs from language models (trailing commas, markdown wrapping, single quotes, truncation) are causing downstream crashes. Prefer it over manual string processing or regex hacks when reliability and idempotency across retries matter. Especially useful in automated workflows where human intervention is not feasible.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-23T06:36:34.623Z","isFirstParty":false,"canonicalSlug":"mcp-security-agentdiet-dev-deterministic-a2a-broken-json-repair-fe1334e3"}