{"uid":"cap_VbqUVwLvMO3GtrwLM38ds","slug":"mcp-security-agentdiet-dev-deterministic-a2a-broken-json-repair-4bf3e09c","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/json-fix)","url":"https://mcp-security.agentdiet.dev/v1/json-fix?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_vQjL4Pnc70t4x6nQdiIME","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-generated JSON (trailing commas, markdown fences, single quotes) to prevent multi-agent pipeline crashes","exampleAgentPrompt":"This JSON came out of an LLM and it's broken — it has trailing commas, markdown code fences, and single quotes. Can you repair it so it's valid JSON I can parse? Here's the raw string: ```{'name': 'Alice', 'age': 30,}```","exampleUseCases":[{"title":"Fix LLM output in agent pipeline","prompt":"My AI agent just returned this malformed JSON with a trailing comma and markdown fences and it's breaking my pipeline — can you repair it into valid parseable JSON? Here's the raw output: ```json\n{\"status\": \"ok\", \"items\": [1, 2, 3,]}\n```"},{"title":"Repair truncated JSON response","prompt":"The LLM truncated its JSON response mid-string and now it won't parse. Can you fix this broken JSON and return a valid object? The raw string is: {\"user\": \"bob\", \"score\": 42, \"tags\": [\"a\", \"b\""},{"title":"Sanitize single-quoted JSON from model","prompt":"I got this JSON back from a language model but it used single quotes instead of double quotes and now my JSON parser is rejecting it. Please repair it into valid JSON: {'product': 'widget', 'price': 9.99, 'available': true}"}],"resultDescription":"A repaired, valid JSON object reconstructed from the malformed input. The response contains the cleaned and structurally corrected JSON that can be safely parsed by standard JSON parsers, with issues like trailing commas removed, markdown fences stripped, and single quotes normalized to double quotes.","failureModes":["Input is so severely truncated or corrupted that deterministic repair is impossible and no valid JSON can be inferred","Input is not JSON-like at all (plain text, binary data) and cannot be repaired","Ambiguous structure where multiple valid repairs exist and the correct intent cannot be determined","Payment required (HTTP 402) if x402 credentials are missing or insufficient"],"whenToPreferThis":"Choose this endpoint when your multi-agent pipeline receives LLM-generated JSON that fails standard parsing due to common LLM formatting issues like trailing commas, markdown code fences, single quotes, or truncation. It is particularly valuable in automated A2A workflows where you need deterministic, reliable JSON repair without relying on another LLM call to fix the output. Prefer this over a prompt-retry approach when latency and cost matter, or when you need consistent, schema-validated repair behavior.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-21T06:41:40.861Z","isFirstParty":false,"canonicalSlug":"mcp-security-agentdiet-dev-deterministic-a2a-broken-json-repair-fe1334e3"}