Code mode is supposed to be the faster way for agents to call MCP tools. Fewer round trips, smaller context.
We raced it against classic tool calling on the same task.
Code mode lost by 39 seconds.
The reason isn't a code mode problem. Most MCP servers ship input schemas and nothing else, so the agent knows exactly what to send and has to guess what comes back.
It guessed wrong three times, and every wrong guess is a full extra turn.
So we built a shape cache that remembers what each tool returns and carries it across sessions.
The Rematch:
- 27% faster than classic,
- 47% cheaper
- 42% less context.
Read how we turned the loss into a win: