{"uid":"cap_ghRP7T4MFv68C7qB89sT4","slug":"defi-yield-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-30601c6b","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://defi-yield.agentdiet.dev/v1/repair)","url":"https://defi-yield.agentdiet.dev/v1/repair?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_dzlro_vhygWJjJlDjZ0Vx","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"defi-yield.agentdiet.dev","brandSlug":"defi-yield-agentdiet-dev-mpp","brandBaseUrl":"https://defi-yield.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":"The JSON response I got from the LLM is broken — it has trailing commas, markdown code fences, and got cut off halfway through. Can you repair it so it's valid JSON I can actually use? Here's the raw string: ```json {\"name\": \"Alice\", \"score\": 42, }```","exampleUseCases":[{"title":"Fixing LLM tool-call JSON before routing","prompt":"My orchestrator agent just got back a JSON tool-call response from the sub-agent but it has trailing commas and single quotes everywhere — can you repair this raw string so it's valid JSON I can pass downstream? Here it is: {\"action\": 'search', \"query\": \"best ETH yield\",}"},{"title":"Recovering truncated pipeline output","prompt":"The language model cut off mid-response and I'm left with an incomplete JSON object. Can you repair and complete it to the nearest valid JSON? Here's what I got: {\"results\": [{\"id\": 1, \"value\": \"foo\"}, {\"id\": 2, \"val"},{"title":"Stripping markdown fences from agent response","prompt":"My agent returned its JSON wrapped in triple-backtick markdown fences and the downstream parser is choking on it. Can you strip the fences and fix any other issues to give me clean, valid JSON? Here's the raw output: ```json\n{\"status\": \"ok\", \"data\": [1, 2, 3]}\n```"}],"resultDescription":"A JSON object containing the repaired, valid JSON output derived from the malformed input string. The response should be parseable and schema-compliant JSON suitable for immediate use in downstream agent pipeline steps.","failureModes":["Input JSON is so severely malformed it cannot be deterministically repaired — returns error or best-effort partial result","Network timeout or service unavailability returns HTTP 5xx","Payment not processed (x402) results in HTTP 402 requiring USDC payment on Base","Input string is empty or missing raw_json field causes HTTP 400 validation error","JSON is valid as-is but schema-level constraints are violated — may return unchanged with a warning"],"whenToPreferThis":"Choose this endpoint when you need deterministic, rule-based JSON repair rather than LLM-based re-generation — ideal for multi-agent pipelines where speed, cost predictability, and reproducibility matter. Prefer it over prompting a model to re-format its output when you need guaranteed idempotency (use the Idempotency-Key header for safe retries) and sub-100ms repair latency. Best suited for fixing common LLM output artifacts: markdown code fences, trailing commas, single-quoted keys, and truncated objects.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-24T18:51:29.846Z","isFirstParty":false,"canonicalSlug":"defi-yield-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-ff23e186"}