{"uid":"cap_KifqKL045Hub2yaHU2u9s","slug":"prompt-guard-agentdiet-dev-deterministic-a2a-broken-json-repair-bdd48fee","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/schema-repair)","url":"https://prompt-guard.agentdiet.dev/v1/schema-repair?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_7hz2QxT1-W0VBmgY6i1dO","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) and validates it against a schema so multi-agent pipelines never crash on bad output.","exampleAgentPrompt":"This JSON string from my LLM output is broken — it has trailing commas and markdown code fences wrapping it — can you repair it and give me back valid JSON? Here it is: ```{\"name\": \"Alice\", \"age\": 30,}```","exampleUseCases":[{"title":"LLM pipeline JSON crash recovery","prompt":"My AI agent just produced this malformed JSON with trailing commas and single quotes that's crashing my pipeline — can you repair it and return something parseable? Here's the raw output: {'name': 'Bob', 'score': 42,}"},{"title":"Strip markdown fences from agent output","prompt":"The LLM wrapped its JSON response in triple backtick markdown fences and now my parser is failing — can you clean that up and give me valid JSON? Raw output: ```json\n{\"status\": \"ok\", \"count\": 5}\n```"},{"title":"Validate and fix truncated JSON response","prompt":"I'm getting truncated JSON from a model that cut off mid-object — something like {\"items\": [{\"id\": 1, \"label\": \"foo\" — can you repair it and validate that the result is well-formed JSON?"}],"resultDescription":"A repaired, well-formed JSON object that was deterministically fixed from the provided malformed input. The response includes the corrected JSON payload that can be safely parsed and used downstream in agent pipelines.","failureModes":["Input JSON too severely truncated or corrupted to infer structure — returns error indicating unrecoverable input","Empty or whitespace-only raw_json input — returns validation error","Non-JSON input that cannot be interpreted as JSON even with repairs — returns parse failure","Network timeout or service unavailability — returns 5xx error","Payment not provided or insufficient — returns HTTP 402 requiring x402 USDC micropayment"],"whenToPreferThis":"Choose this endpoint when you need deterministic, rule-based JSON repair for LLM outputs rather than heuristic or model-based correction. It is ideal for multi-agent pipelines where broken JSON from upstream language models (trailing commas, markdown fences, single quotes, truncation) would otherwise crash downstream processing. Prefer it over manual parsing logic when you need a reliable, cheap ($0.002/call) programmatic fix with schema validation built in.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:23:49.061Z","isFirstParty":false,"canonicalSlug":"prompt-guard-agentdiet-dev-deterministic-a2a-broken-json-repair-9a6e7e44"}