The Bitter Lesson of Tool Calling
This paper empirically demonstrates that programmatic tool calling, which utilizes typed Python stubs for tool invocation, is a robust and often superior alternative to native JSON tool calling across diverse language models and challenging conditions like parallel execution and context degradation.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine you have a super-smart robot assistant that can talk to the outside world. To get things done, this robot needs to ask for help from other programs, like checking the weather or calculating a math problem. For a long time, the only way the robot could ask for help was by speaking in a very strict, rigid format called "JSON." Think of this like a robot that can only send requests on tiny, pre-printed postcards. If it needs to do three things, it has to write three separate postcards, wait for a reply to the first one, then write the second, and so on. It's orderly, but it's slow and clumsy.
However, since this robot is also a brilliant coder, scientists wondered: why not let it just write a computer program to do the work? Instead of postcards, the robot could write a short script—a set of instructions that tells the computer exactly what to do in one go. This is called "programmatic tool calling." It's like giving the robot a pen and a notebook instead of just postcards. The big question was: Is this new, flexible way actually better, or is the old, rigid postcard method still the king of the hill? This paper dives into that question to see if letting the robot write code makes it a faster, smarter, and more reliable helper.
The researchers set up a massive test using 14 different versions of these AI models, ranging from older ones to the very latest, most powerful generations. They put them through a gauntlet of 309 different tasks, from simple single-step jobs to complex scenarios where the robot had to do many things at once or chain steps together. They compared the old "postcard" method (JSON tool calling) against the new "script" method (programmatic tool calling).
The results were a bit of a surprise and a bit of a lesson in how technology evolves. The study found that for most of the newer, smarter models, writing a script was just as good as, or even better than, sending postcards. In fact, the newest family of models (the GPT-5.6 series) got a huge boost, improving their accuracy by about 10.6% when allowed to write code. It was like giving a race car driver a better track; they didn't just run faster, they ran smarter.
But here is the twist: the paper suggests that this new method isn't a magic wand for every robot. The older models actually struggled with the script approach. Three of the older models got confused when asked to write code, producing broken scripts that crashed because they couldn't handle the formatting correctly. It seems that the ability to use this new, flexible method depends heavily on how "new" and capable the model's brain is. The paper argues that the difference isn't about which company made the robot (like Anthropic vs. OpenAI), but rather which generation of the robot it is. The newest ones are ready for the script; the older ones are still stuck on postcards.
The researchers also tested how these methods held up under pressure. When the robot had to do many things at once (like sending 100 requests simultaneously), the old postcard method started to break down, dropping calls and missing tasks. The script method, however, kept chugging along, handling the workload without missing a beat. Similarly, when the robot was given a huge amount of confusing information to sift through (a "context rot" test), the script method stayed stable, while the old method showed some variation in performance.
So, what's the takeaway? The paper suggests that for the latest and greatest AI models, letting them write code to call tools is a viable, robust, and often superior alternative to the old rigid methods. It handles complex chains of tasks faster and doesn't get overwhelmed when the workload gets heavy. However, this isn't a universal fix yet. If you are using an older model, you might still need to stick to the old postcard style, or the robot might just trip over its own feet. The "bitter lesson" here is that while the future looks bright for code-based agents, we have to make sure our tools are actually smart enough to handle the upgrade.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.