Skip to main content
AI JSONMedic

AI and LLM JSON

JSON from AI Models: Why It Breaks and How to Fix It

Language models break JSON in a handful of repeatable ways: markdown fences, Python literals, trailing commas, truncated streams and schema drift. Each provider has its own pattern; the guides below name the pattern and the repair, and the tool fixes all of them in one pass.

ChatGPT and OpenAI

JSON mode guarantees syntax, not your schema; structured outputs guarantee the schema, not every model supports it.

Claude and Anthropic

Most Claude JSON failures are 400 errors from the tool schema or the request shape, not from the model's text.

Gemini, DeepSeek and local models

Smaller and self-hosted models truncate and improvise more; grammar-constrained decoding fixes syntax but not meaning.

MCP — Model Context Protocol

MCP errors are JSON-RPC 2.0 errors plus schema validation on inputSchema and outputSchema, now on draft 2020-12.

Structured output and schemas

Schema-valid JSON can still be wrong; validate the shape with a schema and the values with an inspection step.

Agents and pipelines

Multi-step agents compound small JSON faults; repair at every tool boundary, not only at the end.

Still dealing with broken JSON?

Paste it in and get it fixed in under 1 second — free, no signup, no install. Works with ChatGPT, Claude, n8n, and any AI output.

Fix My JSON Free →

Every guide here is written from reproduced cases by the maintainer of the repair engine — about the site.