{"uid":"cap_qLkJoUsoBu5VaHr6sVxsg","slug":"prompt-guard-agentdiet-dev-deterministic-a2a-broken-json-repair-9a6e7e44","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/repair)","url":"https://prompt-guard.agentdiet.dev/v1/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_s-0tNTpIEVpk_HYLMbxZQ","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":"Fix this broken JSON from the LLM response — it has trailing commas and markdown fences and is crashing my pipeline: ```{\"name\": \"Alice\", \"score\": 42,}```","exampleUseCases":[{"title":"Repairing LLM pipeline JSON crashes","prompt":"This JSON string coming out of my language model keeps crashing my downstream parser — it has trailing commas and is wrapped in markdown code fences. Can you repair it so it's valid? Here it is: ```{\"items\": [\"a\", \"b\",], \"count\": 2}```"},{"title":"Fixing single-quoted agent response JSON","prompt":"My agent returned JSON using single quotes instead of double quotes and now nothing can parse it. Can you fix this so it becomes proper JSON? Here's the string: {'user': 'bob', 'active': True}"},{"title":"Recovering truncated LLM JSON output","prompt":"The LLM cut off mid-response and the JSON is truncated — it's missing the closing brackets. Can you deterministically repair this so I can continue processing it? The raw string is: {\"results\": [{\"id\": 1, \"value\": \"foo\""}],"resultDescription":"Returns a repaired, valid JSON object derived from the malformed input — with trailing commas removed, markdown fences stripped, single quotes normalized to double quotes, and truncated structures closed where possible.","failureModes":["Input JSON is too severely malformed to deterministically repair — returns error indicating repair failure","Missing required raw_json parameter — returns 400 bad request","JSON is ambiguous in its truncation point — repair may not match original intent","Payment not completed via x402 — returns 402 Payment Required","Service unavailable or timeout — returns 5xx error"],"whenToPreferThis":"Choose this endpoint when your multi-agent pipeline receives LLM-generated JSON that fails standard parsing due to common issues like trailing commas, markdown code fences, single-quoted keys, or truncation. It is especially suited for deterministic, rule-based repair rather than AI-based guessing, making it reliable for production pipelines where consistency matters. Prefer it over manual regex hacks or custom parsers when you need a maintained, hosted solution with predictable behavior.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:26:02.250Z","isFirstParty":false,"canonicalSlug":"prompt-guard-agentdiet-dev-deterministic-a2a-broken-json-repair-9a6e7e44"}