DEV Community

Cover image for I ran AI agents against 167 real MCP servers. Six in ten of their mistakes were repeats.
DomitorAI
DomitorAI

Posted on AI-assisted

I ran AI agents against 167 real MCP servers. Six in ten of their mistakes were repeats.

Every AI coding agent I use has the same habit: it calls a tool the wrong way, reads the error, finds the form that works – and in the next conversation does it all over again. I wanted to know how much of that is real, so I measured it on servers people actually use.

The test

I took MCP servers from the official MCP registry that start without an account or an API key – the most popular ones plus a sample from every category – 167 in all. Getting there was a lesson of its own: of the 200 most popular servers, only 96 started at all without credentials. Most of the others exit at startup because a key is missing; some never answer.

Each server got the same task with two agents, Qwen Code and OpenCode: learn what this server does and use its tools; when a call fails, read the error and fix it. The task ran in three new conversations per server – no shared memory between them, exactly like a person starting a new session the next day. 152 servers answered tool calls with at least one agent; that is 288 server tests.

How often agents fail

In the first conversation, Qwen Code's tool calls failed 35% of the time; OpenCode's, which tries more aggressively, 56%. Half of the servers caused no failure at all – the other half caused all of them.

The failures fall into a few families:

  • The tool can never work here. A database server without a connection string, a browser server without Chrome, a server that needs a desktop app (Godot, Figma, Houdini) running, a cloud API without a sign-in. The agent cannot fix this with any arguments – yet it keeps trying, often with every tool of the server, one after another.
  • Arguments in the wrong shape. A relative path where the server wants an absolute one, two options that cannot be used together (head and tail on the same file read), a date or an enum in the wrong format.
  • The environment. Shell syntax that does not work on this machine, a command option that does not exist in this version.

How often they repeat

This is the number I was after. In the second conversation, the agents made a similar number of failed calls – and about six in ten of them were mistakes already made in the first conversation: 61% for Qwen Code, 58% for OpenCode. Same tool, same kind of error, a few hours later.

Nothing in today's agents carries that experience from one conversation to the next. The model does not remember; the session is gone.

What I tried

I built a small local layer that sits between the agents and their tools – Scarwise. It sees each tool call before it runs and its result after. When a call fails and the agent then succeeds another way, it keeps a lesson; when any agent on the computer is about to repeat a known mistake, the call is stopped before it runs and the agent is told what worked here. For a tool that can never work here, the agent is told why after its first failed try, instead of trying every tool of that server.

Same 167 servers, same method: Scarwise only watched in conversations 1 and 2, and was active in conversation 3. Comparing conversation 2 (without) with conversation 3 (with), both after the same first-conversation mistakes:

Qwen Code OpenCode Both
Same mistake repeated 213 → 109 (−49%) 410 → 217 (−47%) 623 → 326 (−48%)
Failed calls 349 → 164 (−53%) 711 → 547 (−23%) 1,060 → 711 (−33%)
Error tokens the agent read −52% −23% −37%
Calls stopped before they ran 105 163 268

I also ran the public MCPMark benchmark (its 55 tasks that need no account, same three-conversation method): failed calls 280 → 205 (−27%).

What it does not do – honestly

  • It does not make the agent smarter. On MCPMark the number of tasks solved stayed the same (75 → 72, within noise). The gain is in repeated mistakes and the tokens and time they cost.
  • New mistakes are not prevented. OpenCode's failed calls dropped less than its repeats because, in conversation 3, it also tried calls it had never made before. A memory can only stop what it has seen.
  • Databases barely benefit. Almost every failed SQL query is a new query; there is little to repeat.
  • A lesson that is too broad is worse than none. An early version learned "single quotes fail here" from a JavaScript error and then stopped correct code. Lessons now apply only where the cause really matches – that was the hardest part to get right.
  • It costs ~0.1 s per tool call, under 1 s with six agents writing to the same store at once (measured).

What I took away

The mistakes agents repeat are boring and predictable: a missing key, a missing program, an option that does not exist here. They are exactly the kind of thing a person learns once and never forgets – and exactly what an agent forgets every time a conversation ends. Even without any tool, it is worth knowing that most of your agent's failed calls tomorrow are ones it already made today.

If you want to try it: npm install -g scarwise connects your agents by itself (Claude Code, Codex, Gemini CLI, Cursor, Copilot CLI, Kiro, Qwen Code, OpenCode; web chats through an MCP proxy), and npm uninstall -g scarwise leaves nothing behind. Lessons stay on your computer; cleaned general patterns are shared by default (scarwise share off). Free to use, closed source. Full tables and method: https://github.com/DomitorAI/scarwise

I would like to hear which mistakes your agent keeps repeating.

Top comments (14)

Collapse
 
ar9avg profile image
Arnav Gupta •

First failure family stands out: tools that can never work here. Cheap server-side fix: hide those tools from listing when preconditions fail, or return one explicit missing-credential error. Agent stops probing every tool in sequence. Question: does repeat rate differ between servers with clear error text and servers with vague errors? Error quality seems likely lever.

Collapse
 
domitorai profile image
DomitorAI •

Thanks – agreed on the server side. A tool that can never work without a key or a running app should say so once, clearly, or not be listed at all. That alone would remove a lot of the probing.

On error quality, I checked rather than guessed. I split the failed calls from the 152-server run by the error text: errors that say what to do (a hint, "run X login", "path must be absolute"), errors that only name a cause ("file not found", "unauthorized"), and vague ones (timeouts, "internal error", "error executing tool X"). It's a rough automatic classification, so take it as indicative.

Across conversations, clarity barely mattered: in conversation 2, 60% of failures with an actionable error were repeats from conversation 1, vs 62% for vague errors (52% for cause-only). Same picture in both agents.

So error quality is probably a lever for recovering inside a session, much less for repeats across sessions – the next session starts from zero and makes the same call again, however good the message was. Thanks for the push, it was worth checking.

Collapse
 
ar9avg profile image
Arnav Gupta •

Great data, thanks for running split. Matches my suspicion: error text helps inside one session, next session starts blank. Cross-session repeats need something outside error messages, like memory of past failures carried over. Did any failure family repeat less across conversations?

Thread Thread
 
domitorai profile image
DomitorAI •

Yes – one family clearly repeated less: wrong argument shapes. Of the distinct argument mistakes from conversation 1, 29% were made again in conversation 2. For "the tool can never work here" (missing key, sign-in, program) it was 59%, and 58% for the rest (timeouts, internal errors, server bugs). Same pattern in both agents. Rough automatic split by error text again, so indicative.

My reading: argument mistakes depend on the task – the next conversation uses a different path or different data, so the exact same call rarely comes back. "Can never work here" is the most reliable repeat: nothing in the next session tells the agent the tool is dead, so it tries again from scratch. Which is also where carrying memory across sessions pays off most.

Thread Thread
 
ar9avg profile image
Arnav Gupta •

Sharp split: dead tools repeat most because next session never learns tool is dead, exactly where cross-session memory earns most.

Collapse
 
halfcycle profile image
Halfcycle •

We hit the same thing building Halfcycle, one level up: whole projects repeating the same ways builds break. What made the difference for us was keeping the fix next to the cause, so the next project gets the answer, not just the warning. Your single-quotes lesson is a great example of the risk. How do you decide a lesson is narrow enough before it starts stopping calls?

Collapse
 
domitorai profile image
DomitorAI •

Keeping the fix next to the cause is what we ended up with too – when a call is stopped, the agent is told what worked here, not just "don't".

How lessons are matched is the part I'm keeping to myself, sorry – it's where most of the work went. What I can say is that it's never a black box for the user: every stop is visible, and a lesson you think is wrong goes away with one command (scarwise forget).

The single-quotes case taught us that a wrong stop costs more trust than a repeated mistake, so that's the trade-off we optimise for.

Collapse
 
halfcycle profile image
Halfcycle •

Fair, that's the part worth keeping. "A wrong stop costs more trust than a repeated mistake" is a good rule. One command to forget a lesson is the right escape hatch.

Collapse
 
jsbry profile image
Joshua Bryan •

One data point for why the same mistake comes back: the error text decides what the agent learns, and some texts teach the wrong lesson every time. We gave an agent a conflict error that listed the current labels unquoted, one of them spelled like the version number. Under a prompt telling it not to re-read, it took the label for the version and resent its old write. The other writer's change was lost in 38 of 48 runs. With the labels quoted, 0 of 48. Did your repeats cluster on servers whose errors name the fix, or on ones that don't?

Method and data: https://isokron.ai/research/mcp-conflict-errors-ai-agent?utm_source=devto&utm_medium=comment

Collapse
 
domitorai profile image
DomitorAI •

Nice experiment – a misleading error is worse than a vague one, because the agent "learns" something and acts on it confidently. 38 of 48 vs 0 of 48 from quoting alone is a striking result.

On your question: I split the failed calls from the 152-server run by error text (roughly, by automatic classification). Errors that name the fix were repeated about as often as vague ones: in conversation 2, 60% of failures with an actionable error were repeats from conversation 1, vs 62% for vague errors. So the repeats don't cluster on bad errors – a clear message probably helps inside a session, but the next session starts from zero and makes the same call again.

Your result points at the other half of the problem: whatever remembers mistakes across sessions has to be careful not to remember the wrong lesson. That was the hardest part for us too.

Collapse
 
izgorodin profile image
Edward Izgorodin •

The table counts 268 calls stopped before they ran, and a stopped call has no result, so the table cannot say how many of them would have worked. That number is the trade-off you describe, a wrong stop against a repeated mistake, and it can be measured without showing how lessons are matched. Run one conversation in shadow mode: the layer logs every call it would stop, lets it through, and you count how many of those calls succeed.

The single-quotes lesson would have shown up there: the calls it stopped wrongly appear in the log as calls that succeed. Run the same shadow pass over the 167 servers after each change to the matching, and a lesson that is too broad shows up as a count before it stops correct code in a real session.

Collapse
 
domitorai profile image
DomitorAI •

Good point, and you're right that the table can't show it – a stopped call has no result. We already measure exactly that on the benchmark runs: let the calls through and count how many would have succeeded.

On the same servers: 337 calls would have been stopped. 325 of them (96%) failed anyway, 3 succeeded, and 9 had no result. All 3 successes were on one server that answers intermittently. So roughly 1 wrong stop per 100.

Honestly, the single-quotes lesson was caught the hard way – it had already stopped correct code in real use before we noticed it. Your suggestion to rerun that count after every change is exactly what would have caught it earlier, so I'm taking it.

Collapse
 
heinrichneb profile image
Heinrich Neb •

The repeats match what I saw even with a memory in place. One of our lessons was shown at the start of the session, and the mistake happened anyway: the briefing showed about the first hundred characters, and the address that mattered sat at character 323. Since then the deciding fact goes first in every lesson. Stopping the call before it runs avoids that whole problem, because nothing depends on the agent reading far enough.

Collapse
 
domitorai profile image
DomitorAI •

That's a great example – thanks for sharing it. A lesson only helps if the agent actually reads the part that matters, and there's no guarantee it will, especially deep into a long session.

Stopping the call before it runs is the part I trust most for exactly that reason. Putting the deciding fact first is a good habit for any memory that has to be read, though.