{"uid":"cap_Hilh8Y5q2eYgQxrKE-mHv","slug":"agentdiet-json-validator-repair-7518e3b7","name":"AgentDiet JSON Validator & 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://agentdiet.dev/v1/json-validator)","url":"https://agentdiet.dev/v1/json-validator?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_iNVo7QHjr-HlIB2gByG6X","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null},{"uid":"pm_O3MO_S7Fctd90ytQFHChJ","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":"Repairs malformed or truncated LLM JSON outputs (trailing commas, markdown fences, single quotes) and validates them against a schema so multi-agent pipelines don't crash.","exampleAgentPrompt":"This JSON from the LLM has trailing commas and markdown code fences wrapping it — can you run it through the JSON repair validator and give me back clean, parseable JSON? Here it is: ```json {\"name\": \"Alice\", \"score\": 42,} ```","exampleUseCases":[{"title":"Fix crashed agent pipeline JSON","prompt":"My downstream agent keeps crashing because the upstream LLM returned JSON with a trailing comma and single-quoted keys. Can you repair this JSON so the pipeline can continue? Here's the broken output: {'model': 'gpt-4', 'tokens': 1200,}"},{"title":"Strip markdown fences from LLM response","prompt":"The model returned its JSON wrapped in a markdown code block with triple backticks and I need clean raw JSON to feed into my next step. Can you strip the fences and validate it? The raw output is: ```json\n{\"status\": \"ok\", \"data\": [1,2,3]}\n```"},{"title":"Validate truncated JSON before storage","prompt":"I got what looks like a truncated JSON response — it's missing its closing braces. Can you repair it and tell me if it's valid? The string is: {\"user\": \"bob\", \"results\": [{\"id\": 1, \"value\": \"test\""}],"resultDescription":"Returns a repaired, schema-conformant JSON object with any syntax errors corrected — trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncated structures closed — ready for downstream consumption in a multi-agent pipeline.","failureModes":["Input JSON too severely corrupted to repair — returns error indicating irrecoverable structure","Empty or null raw_json query parameter — returns validation error","Non-JSON input (e.g. plain text blob) passed as raw_json — may return partial repair or failure","Rate-limit or payment failure for x402 micropayment — returns 402 Payment Required"],"whenToPreferThis":"Choose this endpoint when an LLM or AI agent in your pipeline is producing syntactically invalid JSON (trailing commas, markdown fences, single quotes, truncation) and you need a deterministic, lightweight repair before passing data to a downstream step. Prefer this over manual string-munging or custom regex when reliability and schema validation matter in automated multi-agent workflows.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-20T12:48:05.282Z","isFirstParty":false,"canonicalSlug":"agentdiet-json-validator-repair-7518e3b7"}