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.

Reddit r/AI_Agents Tools

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.

when an agent has a handful of tools, calling them directly works fine. The problems start as the list grows. Every tool schema sits in the context before the agent does any real work, and the model starts reaching for the wrong tool or calling them in a clumsy order. The usual fixes buy a little room, then stop. Shorter tool descriptions, grouping related tools, a stricter system prompt about when to use what. Each one helps a bit. None of them hold once a task needs several tools in sequence. The approach that holds up is to stop exposing every tool to the model directly. Give it a small sandbox where it writes a few lines of code that call the tools as functions, then let it loop, filter, and chain them in code instead of one tool call per step. Two things change. The context stops carrying a wall of schemas, so token use per run drops. And the model makes fewer wrong calls, because writing a short script is something it's already good at. The trade-off is real: you're running model-written code now, so what that sandbox can import and reach is the thing to lock down. If you're running a tool-heavy agent, where's the line between keeping direct tool calls and letting the model write code to call them?
Original Article

Similar Articles

Gave an agent 30 tools. It got worse at using the 3 that mattered.

Reddit r/AI_Agents

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?

Reddit r/AI_Agents

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.