{"uid":"cap_KWQ3UB4n5VEoHs18xl971","slug":"prompt-guard-agentdiet-dev-deterministic-a2a-broken-json-repair-ba5421ca","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/structured-output)","url":"https://prompt-guard.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_nrc-rEKLG5RBdY5nvi7gW","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 JSON outputs (trailing commas, markdown fences, single quotes) so multi-agent pipelines never crash.","exampleAgentPrompt":"This LLM response came back with broken JSON — it has trailing commas, markdown code fences, and single quotes instead of double quotes. Can you repair it so I can parse it? Here's the raw string: ```{name: 'Alice', age: 30,}```","exampleUseCases":[{"title":"Fixing LLM output in agent pipeline","prompt":"My language model returned JSON wrapped in triple backticks with a trailing comma and I need to feed it into the next step — can you clean it up so it's valid? Here's the raw output: ```{\"name\": \"Bob\", \"score\": 95,}```"},{"title":"Repairing truncated structured output","prompt":"The JSON I got from the LLM was cut off mid-string and looks like {\"items\": [{\"id\": 1, \"val — can you repair it so it's parseable again?"},{"title":"Sanitizing single-quoted JSON keys","prompt":"I have a JSON string where the LLM used single quotes everywhere instead of double quotes, like {'key': 'value', 'count': 5} — can you convert it to valid JSON?"}],"resultDescription":"Returns a repaired, valid JSON object that has been deterministically fixed from the malformed input — with trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncations resolved where possible.","failureModes":["Input is too severely truncated or corrupted to recover — returns error or best-effort partial output","Input is not JSON-like at all — may return validation error","Network or service unavailability returns HTTP 5xx","Payment failure via x402 returns HTTP 402 if USDC payment not provided"],"whenToPreferThis":"Choose this endpoint when you have malformed, truncated, or LLM-generated JSON that needs deterministic repair before downstream processing in a multi-agent pipeline. Ideal when you need reliable, rule-based fixes (not AI-guessing) for common LLM JSON issues like trailing commas, markdown fences, and single quotes. Prefer over custom regex solutions when operating in an agentic or MCP context.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:23:25.918Z","isFirstParty":false,"canonicalSlug":"prompt-guard-agentdiet-dev-deterministic-a2a-broken-json-repair-9a6e7e44"}