As you add more tools to an agent, it starts calling the wrong ones. Letting the model write code to call them is the fix.
Summary
The post argues that as an agent's tool set grows, direct tool calling degrades, and the more robust fix is letting the model write code in a sandbox to call tools as functions — reducing schema clutter in context and lowering wrong-call rates — at the cost of sandbox security concerns.
Similar Articles
the tool calling part of an agent is a way smaller problem than the models we usually point at it
The article describes the development of a 48M parameter model specialized for tool calling in AI agents, which uses grammar to ensure valid JSON outputs and is open-source for customization on specific API catalogs.
At what tool count does your agent start getting dumber?
The author discusses how AI agents' reasoning degrades with too many tools, noting a cap of 20 tools by Genie Code, and invites community discussion on solutions.
Gave an agent 30 tools. It got worse at using the 3 that mattered.
The author observed that adding more tools to an AI agent decreased its accuracy in selecting the correct tool due to increased classification complexity, and found that using multiple smaller agents with narrower toolsets improved reliability.
Why are so many agent tools just 1:1 API wrappers?
The article argues that many AI agent tools are just 1:1 API wrappers, pushing branching logic into the LLM and causing failures. The author recommends task-shaped tools like upsert_contact that encapsulate search/create/update logic in code, pass known context, validate inputs, and return structured errors.
The worst agent mistakes I've seen were my tool's fault, not the model's
An MCP server developer shares lessons learned from agent failures, arguing that many apparent model mistakes were actually caused by poorly designed tool outputs, ambiguous options, and misplaced instructions. Each fix landed in the tool rather than the prompt.