{"uid":"cap_2zow2MaNg7MH9REebr9-v","slug":"mesh-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-9559ea4b","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://mesh.agentdiet.dev/v1/structured-output)","url":"https://mesh.agentdiet.dev/v1/structured-output?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_uWWLsHQJF-i3LB2OB6eux","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"mesh.agentdiet.dev","brandSlug":"mesh-agentdiet-dev-mpp","brandBaseUrl":"https://mesh.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Repairs truncated or malformed LLM JSON outputs (trailing commas, markdown fences, single quotes) so multi-agent pipelines can process structured data without crashing.","exampleAgentPrompt":"The LLM just returned this broken JSON with trailing commas and markdown fences — can you repair it so I can parse it? Here's the raw string: ```{\"name\": \"Alice\", \"age\": 30,}```","exampleUseCases":[{"title":"Fix LLM pipeline broken output","prompt":"My agent pipeline just crashed because the LLM returned JSON with trailing commas and single quotes — can you repair this raw string so it's valid JSON I can use? Here's what came back: {'name': 'Bob', 'score': 42,}"},{"title":"Strip markdown fences from structured output","prompt":"The model wrapped its JSON response in triple backticks and now my parser is failing — can you clean up this markdown-fenced JSON and give me back a valid object? The raw output is: ```json\n{\"result\": \"success\", \"items\": [1, 2, 3]}\n```"},{"title":"Recover truncated LLM JSON response","prompt":"My LLM response got cut off mid-JSON and now the output is truncated and unparseable — can you repair this broken string and return whatever valid JSON can be recovered? Here it is: {\"user\": \"carol\", \"data\": [\"a\", \"b\""}],"resultDescription":"A repaired, valid JSON object reconstructed from the malformed input string, with issues like trailing commas, markdown code fences, single quotes, and truncation corrected deterministically. The response is a JSON object ready for downstream parsing.","failureModes":["Input string is so severely malformed that deterministic repair is impossible — returns error indicating unrecoverable JSON","Input is completely empty or whitespace — returns validation error","JSON structure is ambiguous after repair (e.g. multiple plausible completions for truncated arrays) — may return best-effort result or error","Service unavailable or payment required (HTTP 402) — returns 402 with payment details","Non-JSON content passed (e.g. plain text, binary) — returns error indicating input is not JSON-like"],"whenToPreferThis":"Choose this endpoint when your multi-agent pipeline receives LLM-generated JSON that fails to parse due to common LLM formatting mistakes (trailing commas, markdown wrappers, single quotes, truncation). It is deterministic and idempotent, making it safe to retry. Prefer this over general-purpose LLM re-prompting when you need a fast, cheap, reliable repair without consuming additional LLM tokens.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-21T12:40:16.945Z","isFirstParty":false,"canonicalSlug":"mesh-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-ae3fa643"}