Why is my agent's output failing the schema it declared?

Most schema failures aren’t garbled output, they’re output that reads fine but doesn’t match the shape you asked for: a field left out, a number returned as a string, an extra key nobody asked for, or the whole object wrapped in a sentence of prose instead of returned raw. That kind of drift is far more common than output that fails to parse at all.

The rest usually comes from length and formatting pressure: a response truncated mid-object, a trailing comma, or markdown fences left around what should be raw JSON. None of it breaks the underlying reasoning, it breaks the contract between what came back and what your code expects to receive.

That gap, between an answer that’s fine and an answer that matches the schema, is exactly what a deterministic validation check is built to catch: not whether the response is good, only whether it matches the shape you declared.

keep reading

More on this.

Two ways to run Tessary.

Tessary is an open-source agent reliability platform. Cloud and self-hosted run the same workflow on the OpenTelemetry traces your agent already emits.

Tessary Cloud

We host it for you. Send your first trace with nothing to deploy and no model key.

what's includedper organization
traces
10,000 per calendar month
stored trace data
1 GB
retention
30 days
model credit
$10, one-time, for triage and root-cause analysis
credit card
not required

Self-hosted Tessary

Run the open-source code on your own infrastructure with one command. Add your own model key for triage and root-cause analysis.

Self-host Tessary for me by following https://github.com/tessaryai/tessary/blob/main/setup.md

docker compose -f oci://docker.io/tessaryai/tessary:compose up -d -y