{"uid":"cap_QrbaCBOjb5Y9e1OFYI0R5","slug":"prompt-guard-agentdiet-dev-deterministic-a2a-broken-json-repair-e64e3dda","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://prompt-guard.agentdiet.dev/v1/llm-json-schema-healer)","url":"https://prompt-guard.agentdiet.dev/v1/llm-json-schema-healer?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_QOvfdRT26GURVCQRng1NW","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"prompt-guard.agentdiet.dev","brandSlug":"prompt-guard-agentdiet-dev-mpp","brandBaseUrl":"https://prompt-guard.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Repairs truncated or malformed LLM-generated JSON (trailing commas, markdown fences, single quotes) to prevent crashes in multi-agent pipelines.","exampleAgentPrompt":"This JSON string I got back from the LLM is broken — it has trailing commas and is wrapped in markdown code fences. Can you run it through the JSON healer to get a clean, valid JSON object back? Here it is: ```json {\"name\": \"Alice\", \"age\": 30,} ```","exampleUseCases":[{"title":"Fix LLM output before downstream processing","prompt":"The LLM just returned this malformed JSON with trailing commas and markdown fences — can you repair it so I can pass it to the next step in my pipeline? Here's the raw output: ```json {\"status\": \"ok\", \"items\": [1, 2, 3,],} ```"},{"title":"Recover truncated agent response JSON","prompt":"My agent's JSON response got cut off mid-string and now it won't parse. Can you heal this truncated JSON so the workflow doesn't crash? Raw string: {\"user\": \"bob\", \"message\": \"hello wor"},{"title":"Sanitize single-quoted JSON from legacy tool","prompt":"I'm getting single-quoted JSON from an older tool that my pipeline can't parse. Can you convert and fix this so it's valid JSON? Here it is: {'product': 'widget', 'price': 9.99, 'available': true,}"}],"resultDescription":"A repaired, syntactically valid JSON object derived from the malformed input, with issues like trailing commas, markdown code fences, single quotes, and truncation corrected deterministically.","failureModes":["Input JSON is so severely malformed that deterministic repair is not possible — returns an error or best-effort partial result","Input string is entirely non-JSON content with no recoverable structure","Truncated JSON missing critical structural elements cannot be reliably completed","Empty or whitespace-only raw_json input returns a validation error"],"whenToPreferThis":"Choose this endpoint when your multi-agent or LLM pipeline receives JSON outputs that frequently contain common syntax errors such as trailing commas, markdown code fences, or single quotes, and you need a deterministic (not heuristic or AI-based) repair to ensure pipeline reliability. Prefer this over writing custom sanitization logic or using general-purpose LLM re-prompting when you need fast, cheap, and predictable JSON normalization at $0.002 per call.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:24:19.018Z","isFirstParty":false,"canonicalSlug":"prompt-guard-agentdiet-dev-deterministic-a2a-broken-json-repair-9a6e7e44"}