← Table of Contents · Page 148 of 868

THE TOOL REGISTRY

Part 5 of 10

ON-DEMAND TOOL DISCOVERY A modern agent may be connected to hundreds of tools. Each tool's name, description, and schema takes up space in the model's reading material, called its context. The context window is the limited amount of text the model can read at one time, and you will study it carefully in Part Five. If you list every tool in every turn, a large share of that limited space is spent on tool descriptions before the real work even begins. Large tool lists also confuse the model, which may choose a wrong but similar-sounding tool. On-demand tool discovery means loading tools only when needed. Think of a mechanic who keeps a rolling cart with only the tools for today's job, rather than carrying the whole workshop to every car. There are several ways to do it. One is category narrowing: the harness first shows only a short menu of tool groups, such as calendar, files, and customer database, and the agent loads a group when it needs it. Another is search: the harness offers a single search-tools tool that finds relevant tool definitions by keyword or meaning, and only the matches are loaded. A third is task-based selection: a small, cheap step decides, from the task description, which handful of tools to expose. Some providers and frameworks now offer built-in tool search features that defer loading of rarely used tool definitions until the model asks for them, though the exact feature names differ and change quickly, so check the current documentation for the platform you use. The savings can be large. If each tool definition uses about 300 tokens, a token being a small chunk of text, roughly three-quarters of a word, then 200 tools cost around 60,000 tokens every turn. Loading five relevant tools costs about 1,500. That is a reduction of about 97 percent in this simple estimate, and the model also chooses better because it sees fewer distractions. The tradeoff is that discovery adds a step, and a poor discovery method may hide the one tool that was needed.
Advertisement
Read Aloud:
0:00 / 0:00