Programmatic Tool Calling

Instead of loading every tool definition into context and letting the model call them one at a time, you give it a code execution environment where it writes the script that calls those tools itself. Intermediate results stay in the container: the model only sees what you choose to return. It is Anthropic answer to context bloat in tool-heavy agents, shipped to GA in November 2025. The principle also works without that API feature, and that is often the form you meet it in inside Claude Code: instead of wiring an MCP server whose every response lands whole in context, you give the agent a script that calls the same service, filters the response and hands back only what matters. One script can chain several servers at once. Anthropic puts a number on the gap in one example from its engineering article on code execution with MCP: a workflow dropping from 150,000 to 2,000 tokens, 98.7 percent less. The cost moves, it does not vanish: a script to write, maintain and run in an environment you control.

Strengths

Limitations

Best for

Official site

View on Coeurdar