Agent Infrastructure

Why AI Agents Give Wrong Answers When Every Tool Call Succeeds

Every tool call succeeded and the answer is still wrong. Find where it broke.

Agent Infrastructure

Why AI Agents Give Wrong Answers When Every Tool Call Succeeds

Every tool call succeeded and the answer is still wrong. Find where it broke.

Agent Infrastructure

Why AI Agents Give Wrong Answers When Every Tool Call Succeeds

Every tool call succeeded and the answer is still wrong. Find where it broke.

Written by

Meryem Cebeci

Date added

Rius view of one LLM call showing its system prompt, user ticket, tool call and tool result
Rius view of one LLM call showing its system prompt, user ticket, tool call and tool result

Suppose an agent answers support questions about customer orders. A user asks how many open orders they have. The trace shows one search_orders call with status OK, then a confident answer. No exception was raised, the error logs are empty, and the answer is wrong. The harness had sliced the tool's output to a fixed length with no marker, and the model counted only the part it was given.

That scenario is hypothetical, but each of its pieces comes from reported cases. The point is general: "the tool call succeeded" and "the answer is right" are different claims. A status check confirms the first and says nothing about the second. This article follows a wrong answer through the handoffs between a tool's return and the model's final text, shows which checks can see each failure, and is explicit about which ones no current check sees.

A success status only certifies that the tool ran

The Model Context Protocol draws the line clearly. A tool execution error is "reported in tool results with isError: true", and clients SHOULD provide these errors to the model "to enable self-correction" (MCP specification, Tools). Our reading: the protocol defines no notion of a successful result that is wrong, so a non-error result that is stale, partial or misjoined passes straight through.

The research suggests four ways a clean-looking run still ends badly:

  • the data is lost or changed on its way to the model;

  • the data is wrong but well-formed;

  • the model doesn't use the data it was given;

  • the context no longer holds the evidence when the answer is written.

There is no cross-agent measurement of how often this happens; the controlled data below covers one harness and one calculator setting.

Truncation you never see

The strongest measurement comes from Sehgal, Panahandeh and Ezzati-Jivan's preprint on information attrition in agent harnesses. They studied one tool-using agent (one harness, one domain, one model) and found that 3,827 of 11,189 tool results were cut before the model saw them, and every cut result became broken JSON. The harness sliced the JSON text at a fixed length, which deletes whatever sits near the end: one field reached the model in 4.7% of calls, another field in the same results in 99.3%.

The same paper surveyed seven agent frameworks at specific releases and found two general-purpose cutters, both slicing by position. At the versions it lists, langchain-core keeps only the first 500 characters of serialized tool output, and smolagents deletes the middle of any observation over 20k characters. Three frameworks don't cut tool output at all, which the authors note "just moves the same loss further along, into the context window".

Here is the nuance that matters. In the authors' controlled experiment, the cost of the cut "appears first as extra work, not as wrong answers": 43% more tool calls, twice the computation, and yield falling from 0.61 to 0.31. The agent still found the right answer when it had another route, and the authors call the question of whether the cut causes the accuracy drop "still an open question". Our reading: in that setting the agent recovered when it had another route to the answer, and whether the cut causes wrong answers more generally is open.

Single-project reports describe the wrong-answer side, at a lower evidence level:

  • An open issue in a small project says tool output is sliced to 2,000 characters with no truncation marker, and that the model "may draw incorrect conclusions from silently partial data". The "may" is the reporter's own suspicion.

  • An open bug in a plugin reports that a sanitizer deletes content between tags in tool output, so a file read returns two lines of a longer file and "the model has no way to know that content was removed".

  • A practitioner post describes, second-hand and anonymised, a search_orders tool returning a truncated, invalid-JSON payload because an upstream gateway had an undocumented 4KB response cap. The model retried the identical call 17 times.

Proposed fixes are a visible truncation marker, pagination, or failing loudly above a size limit. These are proposals, not maintainer-confirmed fixes as of 2026-11-14, and they cost tokens or extra tool calls. Our reasoning for preferring a marker over silent slicing: fixed-length cuts remove data unevenly (the 4.7% versus 99.3% above), so a model has no signal that the evidence it holds is partial. The sources also describe one structure-aware cutter, a shell middleware that cuts by whole lines "and says so", though it isn't the default.

Wrong data that looks right

Truncation at least changes the shape of the output. The next class doesn't. A practitioner taxonomy of silent tool failures names "schema violations, stale data, and semantically wrong results". Of stale data it says: "Stale data failures are invisible to schema validation because the shape is perfect. Only the content is wrong." Semantically wrong results are, in its words, the "most dangerous category", for example a query "joining on the wrong key, filtering with an off-by-one date range, or silently ignoring a WHERE clause". This is a single author's classification, useful as a map rather than as evidence of frequency.

There is research behind the semantic case. The NL2SQL-BUGs benchmark collects 2,018 annotated examples of natural-language-to-SQL translations to test whether models can detect semantic errors. Its authors report that state-of-the-art models "frequently generate semantically incorrect SQL queries" and reach an average detection accuracy of 75.16%. A query that runs and returns rows is not evidence the rows answer the question.

An empty array read as "no data exists" belongs here too. GlassFlow's posts on detecting agent failures and on agent failure modes already cover that example, so we won't repeat it. The check is the same: the status says nothing about whether empty means absent.

When the model doesn't use what the tool returned

Even correct data can fail at the next handoff. Adeniji and colleagues studied GSM8K math problems with a calculator tool whose outputs were sometimes corrupted, across six production models and 30 problems each. They observed "silent tool-output override": the calculator returned a corrupted value, and the model later used "a different, often correct, value without calling the tool again". A verification detector recorded no re-check. The overrides were often correct, so the finding is not that overrides cause wrong answers. It is that the final answer can contain a value no tool returned, and the trace alone doesn't show it. The same paper found that human review agreed with automated labels on final correctness (67 of 67) but on only 67 of 81 traces for verification.

Models can also lean on memory. Xie and colleagues found LLMs "highly receptive" to external evidence when it is coherent and convincing, but showing "a strong confirmation bias" when the evidence contains some information consistent with their parametric memory. The practical consequence: partial or mixed tool output can be bent toward what the model already believes.

A related case is the tool that is never called, so the model answers from memory with no tool evidence at all.

Context that was full, cut or forgotten

Position and length also change what the model uses. Chroma's technical report (July 2025, synthetic tasks) states that model performance "varies significantly as input length changes, even on simple tasks" across 18 LLMs. "Lost in the Middle" found that performance "is often highest when relevant information occurs at the beginning or end of the input context, and significantly degrades when models must access relevant information in the middle", on QA and key-value tasks with 2023-era models.

A full window is not the only way evidence goes missing. In the harness above, the largest prompt was 5.75% of the window while data was still lost. Our reading: when you look for lost evidence, check the cut and the position, not just the fill level.

Follow one wrong answer through four handoffs

Each failure class so far lives at a different place in the run. That suggests a bounded search instead of "it's the model". The method below is ours, built from the evidence above.

The four links:

  1. (a) Arguments sent. What the model asked the tool.

  2. (b) Output as returned. What the tool function returned.

  3. (c) Output as received. What the model was actually sent, after any harness cut, sanitizing or compaction.

  4. (d) Claim in the answer. What the final text asserts, and whether a received output supports it.

Work backwards, cheapest first.

  1. Start at (d). List every number, name and date in the wrong answer and look for each in the tool outputs the model received. A value found nowhere is unsupported: a silent override, an answer from memory, or a model-made inference. Stop here and decide which.

  2. If (d) is supported, compare (c) with (b). If the model received less than the tool returned, the loss is in delivery: a cut, a sanitizer or a compaction.

  3. If (c) equals (b), read (a). A wrong date range, join key or ID produces clean, wrong data, and reading the arguments needs no reference value.

  4. If (a) looks right, check (b) against ground truth. Is it stale, partial or well-formed but wrong? No trace can answer this alone. You need a reference value, a freshness rule or a domain check, which is why it comes last.

The order matters because each step is cheaper than the next and each narrows where the evidence is lost. It stops being valid when the trace doesn't hold complete outputs: capture limits, size caps and privacy settings can remove exactly the content links (b) and (c) need.

Symptom-to-check table

This table maps each symptom to its likely class, the trace evidence that shows it, the cheapest check, and what Rius documents covering it.

Symptom

Likely class

Evidence to read

Cheapest check

Rius coverage

Result shorter than the source; answer uses part of it

Truncation in delivery

Tool span output vs. the tool message and its size on the next generation span

Compare returned and delivered length; add a visible marker

No named finding; comparing the two spans is the route (untested)

Same call repeated with identical arguments

Malformed or empty result, no stop signal

Repeated tool spans with identical arguments

Count identical calls per run; add a stop rule

Tool Loop (at least 3 identical calls in a run, arguments captured); fit to this case is Inference

Final value differs from the tool's value, no second call

Silent override

Tool output vs. final generation's output

Check each value in the answer against logged outputs

No finding; Rius records both sides

Tool never called, answer from memory

Skipped tool

Tool list on each LLM call; usage rate

Compare with the agent's usual tool use

Amnesia rule A (needs baseline and tool definitions)

Right fact buried in a long context

Position effect

Context composition at that call

Move evidence to the start or end; trim history

Context rot shows fill and one tool taking over; not position as such

Clean run, empty result, "no data" conclusion

Empty read as absence

Tool span output

Assert expected non-empty results

None

Well-formed result answering the wrong question

Semantic error

Tool arguments and output

Domain checks; reference cases

None

Sources: Sehgal et al., Adeniji et al., practitioner post on tool loops, tool result validation taxonomy, Rius Tool Loop, Rius Amnesia, Rius Context rot

What no check catches

Three gaps follow from the table.

First, error-based monitoring is blind to this class by construction. Rius's Swallowed Error rule, for instance, excludes tool errors on purpose, because a failed tool call is returned to the model as the tool's result and the agent could act on it. A successful but wrong result isn't an error at all.

Second, skipped-tool and context checks look at usage and size, not at correctness. Our reading of the rule text: Amnesia flags a tool that was offered and never called, and can't flag a tool that was called and returned wrong data. Whether Context rot fires on a single cut result is untested; the docs say a single large result "that gets trimmed away on the next call never fires" its one-tool rule.

Third, semantic errors need ground truth. Schema validation can't see stale data, per the taxonomy above, and trace-level labels can miss silent overrides, per the calculator study. A reference answer, a freshness rule or a claim-versus-output comparison is the only thing that sees them.

Observing each link in Rius

Rius is where the evidence for these links can sit in one place. It shows what each model call was sent and what each tool returned. It doesn't judge whether an answer is correct, so pair it with the ground-truth and claim checks above. The workflow, mapped to the four links:

  1. Trace the tools. Wrap tool functions with observe at the TOOL kind, or use a framework integration that records tool calls. Each tool span records its arguments and return value by default (capture_input and capture_output default to true). This covers links (a) and (b).

  2. Open the failing run and read the tool span. Its input and output are the arguments the model sent and the value the tool returned. Values are truncated at 32 KB in the span, so for very large outputs the span isn't a complete record. When the tool span records the id the model put on the tool call (gen_ai.tool.call.id, set from the tool call id you pass when creating the span), it ties the span back to the model call that asked for it.

  3. Read the tool message on the next generation span. A generation span's input messages include the role: "tool" response the model was sent, and rius.context.sizes gives the byte size of each input part. Comparing this with step 2 is how you observe link (c). Whether a given harness cut shows up as a difference is untested.


Rius view of one LLM call showing its system prompt, user ticket, tool call and tool result


One LLM call in Rius with the actual system prompt, user ticket, tool call and tool result, from our own demo agent.

  1. Compare the answer with what the model received. Read the final generation's output messages. Rius records both sides; you make the comparison, which is link (d).

  2. Check the context at the call that produced the answer. The context-growth strip and the Context rot findings show a context too full, one tool taking over the input, or a drop flagged as lost history or compaction, and the "What was lost" view shows what a drop removed. Since the 2026-11-06 release, an automatic compaction Rius infers from token counts shows as a compaction rather than lost context.


Rius view of a long run showing context growing call after call


How context grows across the calls of a long run (illustrative data).

  1. Check whether the tool was used. The Amnesia Tool usage panel shows each tool's usage rate and up to five sessions that were offered the tool and skipped it. Amnesia judges an agent once it has a baseline (7 days and at least 20 sessions by default).

  2. Check for repeated identical calls. Tool Loop fires on identical normalized arguments at least 3 times in a run, and its documentation lists a broken tool schema retry among its target cases. Whether it fires on a real case like the 17-retry report is untested.

One setting affects steps 2 to 7: with capture_content=False, inputs, outputs and messages are stripped, Amnesia gets no tool definitions and Tool Loop can't compare arguments. Sizes in rius.context.sizes and the context strip still flow.

A checklist for the next wrong answer

  • Extract every value in the wrong answer; find each in an output the model received.

  • Unsupported value: check for an override or a memory answer, and whether the tool was offered and skipped.

  • Supported but wrong: compare what the model received with what the tool returned.

  • Look for cuts, sanitizers and compaction between the tool and the model. Prefer a visible marker, pagination or an explicit failure over silent slicing.

  • Check argument values (dates, IDs, join keys) for semantic errors, then check the returned data against ground truth.

  • Confirm your capture settings keep the outputs and messages you need.

  • Add a ground-truth or claim-versus-output check; error alerts won't see this class.

If you want these records for your own agent, the Rius quickstart shows how to send traces so you can read tool outputs, generation messages and context sizes for a run side by side.

Sources and further reading

Share the article

You might also like

Two products.
Two starting points.

Tares is open source. Kick the tires, open an issue, and drop a star
if it's useful.
Rius, end to end. Guides for wiring up traces, MCP, and

retention, from first span to production.

Give your agent one place to look. Everything your
systems emit, in one call.

Two commands and a source

you already run.

Ready to give your agents better data and total recall?

Start with Tares

Self-improving software factory.

Start with Rius

See and debug agents in production.

2026 - Copyright GlassFlow.ai

Ready to give your agents better data and total recall?

Start with Tares

Self-improving software factory.

Start with Rius

See and debug agents in production.

2026 - Copyright GlassFlow.ai

Ready to give your agents better data and total recall?

Start with Tares

Self-improving software factory.

Start with Rius

See and debug agents in production.

2026 - Copyright GlassFlow.ai