Code Mode
A paradigm for MCP tool invocation in which the agent writes code against tool stubs and a runtime executes the code to complete tool calls, thereby compressing context usage and improving efficiency.
Timeline (last 90 days)
The NBIT team calls one agent usage pattern "code mode": the agent can write small programs to filter data and run them in a sandbox, bringing back only the filtered results.
In code mode, the agent no longer directly outputs tool calls; instead, it writes a piece of code against pre-provided tool stubs (function signatures plus brief documentation), and a runtime executes that code to complete the tool calls.
Declaring return-shape hints in code-mode stubs can cause success rates to fluctuate by up to 39.5 percentage points for weaker agents, an effect larger than adding a router.
The study's core hypothesis—that adding a decision layer before code mode would outperform code mode alone—was not confirmed; for weaker agents, the decision layer brought a small and statistically insignificant improvement, while for the strongest agent it instead produced a slight cost increase.
All Facts (4)
The NBIT team calls one agent usage pattern "code mode": the agent can write small programs to filter data and run them in a sandbox, bringing back only the filtered results.
50%UnverifiedIn code mode, the agent no longer directly outputs tool calls; instead, it writes a piece of code against pre-provided tool stubs (function signatures plus brief documentation), and a runtime executes that code to complete the tool calls.
50%UnverifiedDeclaring return-shape hints in code-mode stubs can cause success rates to fluctuate by up to 39.5 percentage points for weaker agents, an effect larger than adding a router.
50%UnverifiedThe study's core hypothesis—that adding a decision layer before code mode would outperform code mode alone—was not confirmed; for weaker agents, the decision layer brought a small and statistically insignificant improvement, while for the strongest agent it instead produced a slight cost increase.
50%