{"uid":"cap_27lPee9ixYUv0orFPO2uC","slug":"x402broker-schema-repair-942b8ac6","name":"x402broker Schema Repair","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://x402broker.com/v1/schema-repair)","url":"https://x402broker.com/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":["x402"],"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":"unknown","protocol":"x402","network":"base","amountUsd":null,"per":"call","confidence":"unknown"},{"kind":"static","protocol":"mpp","network":"tempo","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_KxN7Ao71__s2MUIkkQrke","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null},{"uid":"pm_jHUQGAt7E2U9kfMKclk4m","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Deterministically repairs truncated or malformed LLM-generated JSON (trailing commas, markdown fences, single quotes) and validates it against a schema so multi-agent pipelines don't crash.","exampleAgentPrompt":"The LLM just returned this broken JSON with trailing commas and markdown code fences — can you repair and validate it so the pipeline doesn't crash: ```{\\\"name\\\": \\\"Alice\\\", \\\"score\\\": 42,}```?","exampleUseCases":[{"title":"Fix malformed LLM JSON in pipeline","prompt":"My agent just got back a JSON response from the language model that has trailing commas and is wrapped in markdown triple-backtick fences — please repair it and give me a clean parseable object: ```{\\\"status\\\": \\\"ok\\\", \\\"count\\\": 7,}```"},{"title":"Sanitize single-quoted JSON from LLM","prompt":"The LLM returned JSON using single quotes instead of double quotes and it's breaking my parser — can you fix this string so it's valid JSON: {'user': 'bob', 'active': true}"},{"title":"Recover truncated JSON output","prompt":"The language model's response got cut off mid-object and now the JSON is truncated — repair it as best you can and validate the structure: {\\\"items\\\": [{\\\"id\\\": 1, \\\"name\\\": \\\"widget\\\"}"}],"resultDescription":"Returns a cleaned, repaired JSON object with invalid syntax corrected — trailing commas removed, markdown fences stripped, single quotes normalized to double quotes, and truncation handled — along with a validation result indicating whether the output conforms to the expected schema.","failureModes":["Input JSON too severely malformed to recover — returns error indicating unrecoverable structure","Input string is not JSON-like at all — returns validation error","Schema mismatch after repair — repaired JSON is syntactically valid but does not conform to provided schema","Empty or missing raw_json query parameter — returns 400-level error","Network timeout or service unavailability — returns 5xx error"],"whenToPreferThis":"Choose this endpoint when your multi-agent pipeline receives LLM-generated JSON that fails standard JSON.parse due to common LLM formatting artifacts: trailing commas, markdown code fences, single-quote delimiters, or truncation. It is purpose-built for A2A (agent-to-agent) reliability use cases, is deterministic (not probabilistic), and is cheaper per-call than using another LLM to reformat the output. Prefer it over writing custom regex fixers or calling a general-purpose LLM for cleanup.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-20T12:48:17.040Z","isFirstParty":false,"canonicalSlug":"x402broker-schema-repair-942b8ac6"}