JSON tool calling may be an unnecessary bottleneck for newer AI agents.
Capable models can orchestrate tools better by writing code than by emitting JSON calls.
This paper compares standard JSON calls with a code-first setup where the model writes one Python script that invokes the same tools.
Across 14 models on a 309-task BFCL v4 subset, programmatic tool calling matched or beat JSON in 11, with GPT-5.6-Sol and Terra each improving by 10.6 percentage points.
The gap gets clearer when one task needs many calls.
For Claude Sonnet 5, JSON issued every required call through a fan-out of 70, then started dropping calls; at 100 calls it fell to 0% enumeration accuracy, while Python stayed at 100%.
Sequential chains were faster for 13 of 14 models because several dependent calls can run inside one script instead of requiring another model turn after each tool result.
There is a boundary: several older GPT models got worse because they produced broken multiline Python, and the benchmark uses echo-return stubs rather than real APIs.
- arxiv. org/abs/2608.06370
Title: "The Bitter Lesson of Tool Calling"