{"uid":"cap_jGeVT-jTBbQgD5GGczxco","slug":"token-intel-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-b12b9074","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://token-intel.agentdiet.dev/v1/repair)","url":"https://token-intel.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_CfSsnRI3jdSnjNBA9vDt8","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"token-intel.agentdiet.dev","brandSlug":"token-intel-agentdiet-dev-mpp","brandBaseUrl":"https://token-intel.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Repairs truncated or malformed LLM JSON outputs (trailing commas, markdown fences, single quotes, truncation) so multi-agent pipelines never crash on bad JSON.","exampleAgentPrompt":"The LLM returned this broken JSON with trailing commas and markdown fences — can you run it through the JSON repair service to get a clean, parseable object? Here it is: ```json {\"name\": \"Alice\", \"score\": 42, } ```","exampleUseCases":[{"title":"Fixing LLM output in agentic pipeline","prompt":"My agent just got back this JSON from GPT-4 but it has trailing commas and it's wrapped in a markdown code block — can you repair it so I can pass it to the next step? Here's the raw string: ```json {\"user\": \"bob\", \"score\": 99, } ```"},{"title":"Recovering truncated API response","prompt":"The model's response got cut off mid-JSON and now my pipeline is crashing. Can you try to repair this truncated JSON and give me something parseable: {\"items\": [{\"id\": 1, \"name\": \"widget\""},{"title":"Sanitizing single-quoted JSON from legacy tool","prompt":"I'm getting JSON with single quotes instead of double quotes from an old tool in my workflow, and it's breaking my parser — can you fix this string so it's valid JSON: {'key': 'value', 'count': 3}?"}],"resultDescription":"Returns a repaired, valid JSON object that was previously malformed, truncated, or wrapped in markdown. The response is a JSON object containing the cleaned and validated output, ready for downstream consumption by agents or services.","failureModes":["Input is so severely malformed that deterministic repair is impossible — returns an error response","Input is not JSON-like at all (e.g., plain prose) — cannot repair","Truncation is too severe to infer missing structure — may return partial or error","Network timeout or service unavailability — 5xx response","Missing required raw_json field — 4xx validation error"],"whenToPreferThis":"Choose this endpoint when you need deterministic, rule-based JSON repair rather than probabilistic LLM-based fixing. Ideal for multi-agent pipelines where reliability and idempotency matter, especially when LLM outputs frequently contain trailing commas, markdown fences, or single quotes. Prefer this over writing custom regex or using an LLM to fix JSON, as it is cheap ($0.002/call), fast, and supports idempotency keys for safe retries.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-23T06:31:08.352Z","isFirstParty":false,"canonicalSlug":"token-intel-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-12f4b582"}