Bernat Sampera
← Notes

Programmatic Tool Calling

Context Engineering

Traditional AI tool use works like this: call a tool, 50KB of output enters the context. Call another, another 50KB. Three tools and you have 150KB of noise sitting in the context window, plus multiple inference passes to process it all.

Programmatic tool calling flips this. Instead of calling tools one by one and dumping results into context, the AI writes a script. The tools run in parallel inside that script, the script processes the results, and only the final answer enters context. Less noise, fewer inference passes, better results.