{"uid":"cap_he0N8UqZBr5h7uKlLYP_3","slug":"mcp-security-agentdiet-dev-deterministic-a2a-broken-json-repair-d99e89f9","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-normalizer)","url":"https://mcp-security.agentdiet.dev/v1/json-normalizer?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_MXkBne4fEz4UGV0_Sq9hQ","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 malformed, truncated, or markdown-wrapped LLM JSON outputs (trailing commas, single quotes, fences) so multi-agent pipelines never crash.","exampleAgentPrompt":"This LLM response came back with broken JSON — trailing commas, single quotes, and markdown backtick fences wrapping it. Can you run it through the JSON normalizer to fix it so my pipeline doesn't crash? Here's the raw string: ```{'name': 'Alice', 'age': 30,}```","exampleUseCases":[{"title":"Fix LLM output before downstream parsing","prompt":"My language model just returned this JSON with markdown fences and trailing commas and now my parser is crashing — can you repair it so it's valid JSON I can use? The raw string is: ```{\"items\": [\"a\", \"b\",], 'count': 2}```"},{"title":"Sanitize single-quoted agent response","prompt":"An agent in my pipeline returned JSON using single quotes instead of double quotes, and my downstream step rejected it. Can you normalize this into valid JSON: {'status': 'ok', 'results': ['x', 'y']}"},{"title":"Recover truncated JSON from streaming response","prompt":"I got a truncated JSON blob from a streaming LLM call — it got cut off mid-object. Can you repair and complete it as best you can so I can extract the structured data? Here's what I have: {\"user\": \"bob\", \"score\": 95, \"tags\": [\"alpha\""}],"resultDescription":"Returns a JSON object containing the repaired, standards-compliant JSON parsed from the malformed input, suitable for direct downstream consumption without further sanitization.","failureModes":["Input JSON too severely corrupted to deterministically repair — returns error with description of what could not be fixed","Empty or non-JSON input string — returns validation error","Network timeout or service unavailability — HTTP 5xx response","Payment required but not provided — HTTP 402 response"],"whenToPreferThis":"Choose this endpoint when your multi-agent pipeline receives JSON from LLM outputs that may contain markdown fences, trailing commas, single quotes, or truncation artifacts. It is purpose-built for deterministic (not generative) repair, making it reliable for production pipelines where correctness is required. Prefer this over manual string manipulation or regex hacks when you need a robust, consistent fix for LLM-generated JSON before passing it to typed parsers or downstream agents.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-20T18:38:16.091Z","isFirstParty":false,"canonicalSlug":"mcp-security-agentdiet-dev-deterministic-a2a-broken-json-repair-fe1334e3"}