CertSafari
    Anthropic Claude Certified Architect – Professional (CCAR-P)· Lessons

    Domain 3 · Lesson 19/38

    Tool search vs. loading every tool definition up front

    Evaluate progressive discovery vs. monolithic context strategy

    10 min read
    2.38% of exam
    3 sources
    Published 4 Oct 2026
    Docs as of 30 Sep 2026

    What you will be able to do

    • Name the two costs of loading every tool definition into context up front, and the numbers the documentation gives for each
    • Explain how defer_loading, the tool search tool and tool_reference expansion let Claude find tools on demand
    • Choose between progressive discovery (tool search) and a fixed, cached toolset based on how big the toolset is and how often it changes

    Key concept

    Progressive discovery (on-demand loading) — Claude's context starts with only a small entry point, such as a search tool or a list of short descriptions. Full definitions or instructions load only when the current task needs them. The monolithic approach does the opposite and puts everything in context on every turn, whether or not it gets used.

    1.What a monolithic toolset costs

    The simplest way to give an agent capabilities is to put every tool definition in the request and let all of them load into context. Call this the monolithic strategy. It works for a handful of tools. As the library grows, the tool search documentation describes two separate ways it breaks down.

    The first is context bloat. Definitions use up tokens before Claude has done anything. The documentation's example is a typical multiserver setup with GitHub, Slack, Sentry, Grafana and Splunk, which can consume ~55k tokens in definitions alone. The Agent SDK documentation gives a smaller-scale version: 50 tools can use 10–20K tokens, which leaves less room for the work itself.

    The second is tool selection accuracy. Beyond 30–50 available tools, Claude gets worse at choosing the right one. The extra definitions add noise as well as cost.

    Progressive discovery addresses both. Tool search typically reduces definition tokens by over 85 percent and loads only the 3–5 tools a given request needs. Because Claude only ever sees a small, relevant set, selection accuracy stays high even across a catalog of thousands of tools. The SDK documentation gives the ceiling as 10,000 tools per catalog.

    Checkpoint 1 of 6· Check yourself

    A team connects GitHub, Slack, Sentry, Grafana and Splunk MCP servers and loads every tool definition up front. Which pair of problems does the tool search documentation say this causes?

    Sources12

    2.How tool search works: defer_loading and tool_reference

    On the Claude API, progressive discovery is built into the tool search tool. It runs on the server and comes in two variants. With tool_search_tool_regex_20251119, Claude writes regex patterns. With tool_search_tool_bm25_20251119, Claude writes natural-language queries. Both search tool names, descriptions, argument names and argument descriptions. Claude Opus 4.1 and earlier don't support it.

    You add the search tool to your tools array and mark the tools that shouldn't load up front with defer_loading: true. The flag is easy to misread. It controls what goes into the context window, not what goes into the request. You still send every full definition on every request, deferred ones included, because the API needs them on the server to run the search and to expand the results.

    This is not all-or-nothing. At least one tool has to stay non-deferred, normally the search tool itself, and you must never defer the search tool. The documentation also recommends keeping your 3–5 most frequently used tools non-deferred so Claude can call them without searching first. In practice, then, progressive discovery is a hybrid: a small core that is always loaded, with a searchable catalog behind it.

    Declaring the regex variant of the tool search tooljson
    {
      "type": "tool_search_tool_regex_20251119",
      "name": "tool_search_tool_regex"
    }

    Checkpoint 2 of 6· Fill the gap

    Which field keeps this tool's definition out of Claude's context until a search finds it?

    {
      "name": "get_weather",
      "description": "Get current weather for a location",
      "input_schema": {
        "type": "object",
        "properties": {
          "location": { "type": "string" },
          "unit": { "type": "string", "enum": ["celsius", "fahrenheit"] }
        },
        "required": ["location"]
      },
      " ? ": true
    }

    At runtime, Claude's context initially holds only the search tool and any non-deferred tools. When Claude needs something else, it calls the search tool. The API returns matches as tool_reference blocks (five by default) and expands them into full definitions itself; you never do this expansion. Claude then calls the discovered tool as a normal tool_use, and you return a tool_result as usual. The search call is a server_tool_use with a srvtoolu_... ID, and you never return a tool_result for it.

    Two details remove the usual objections to dynamic tool sets. Deferred tools are kept out of the system-prompt prefix, and discovered tools are appended inline in the conversation, so prompt caching is preserved. Expanded references also persist across the conversation history, so Claude can reuse a tool in later turns without searching again.

    Checkpoint 3 of 6· Put it in order

    Put the tool search flow in order, from configuration to calling the tool.

    1. 1.The API expands the references into full tool definitions
    2. 2.Claude selects from the discovered tools and calls them
    3. 3.Claude's context contains only the tool search tool and any non-deferred tools
    4. 4.Include a tool search tool in the tools list and set defer_loading: true on tools that shouldn't load up front
    5. 5.The API returns matching tools as tool_reference blocks
    6. 6.Claude searches using the tool search tool when it needs additional tools

    Checkpoint 4 of 6· Exam question

    A team builds an internal agent that calls exactly 7 tools, nearly all of which are needed on almost every request, and the combined tool definitions total roughly 1,200 tokens. Which context strategy should they use for tool loading?

    Sources1

    3.Choosing between progressive discovery and a fixed toolset

    Progressive discovery isn't free. The manage-tool-context guide describes the trade plainly: one extra turn to look up a tool, in exchange for a large cut in baseline context use. So the real question is whether your toolset is large enough, and used unevenly enough, that the cut is worth the extra turn.

    The guide's comparison answers this. Tool search fits large toolsets of 20+ tools where most tools aren't needed on every turn. Prompt caching is the better fit when the toolset is large but fixed. Caching doesn't reduce the number of tokens in context, but it reduces what you pay for them on later requests. A monolithic toolset that stays stable and is cached is therefore a legitimate design. What it doesn't fix is the selection-accuracy problem past 30–50 tools, because every definition is still in front of Claude.

    The two strategies also combine. The recommended starting point for a high-volume agent is to enable prompt caching on tool definitions from day one, then add tool search once the toolset grows past roughly 20 tools or baseline context use becomes noticeable.

    Monolithic (cached) toolset vs. progressive discovery
    DimensionMonolithic toolset + prompt cachingProgressive discovery (tool search)
    What it reducesWhat you pay for repeated tool definitionsTool definitions loaded upfront
    Tokens in contextUnchanged: every definition loads on every turnSearch tool, non-deferred tools, and the 3–5 tools discovered for this request
    Best fitStable toolsets across many requestsLarge toolsets (20+ tools) where most tools aren't needed every turn
    Latency costNone addedOne extra turn to look up a tool
    Selection accuracyDegrades once you exceed 30–50 available toolsStays high even across thousands of tools

    Checkpoint 5 of 6· Check yourself

    An agent has 15 tools. The set never changes, nearly every tool is used in most conversations, and the agent handles thousands of requests a day. Which approach does the guidance point to first?

    Checkpoint 6 of 6· Exam question

    An enterprise agent aggregates tool catalogs from GitHub, Slack, Sentry, Grafana, and Splunk MCP servers, and the combined tool definitions consume about 55,000 tokens before the agent does any work. Which strategy best addresses this context bloat?

    Sources3

    Exam traps

    Each one states something that sounds right. Open it to see what is actually true.

    1. 1.Setting defer_loading: true means you can leave that tool's definition out of later requests.Why is that wrong?

      defer_loading only controls what enters the context window. Every full definition must still be sent on every request so the API can run the search and expand tool_reference blocks.

      Covered in How tool search works: defer_loading and tool_reference

    2. 2.For maximum savings, defer every tool, including the search tool and the ones you use most.Why is that wrong?

      The search tool must never be deferred, and the guidance is to keep your 3–5 most frequently used tools loaded so Claude doesn't spend a search turn on them.

      Covered in How tool search works: defer_loading and tool_reference

    3. 3.Prompt caching solves the same problem as tool search, so a cached monolithic toolset is just as lean in context.Why is that wrong?

      Caching lowers the price of repeated definitions but leaves the token count in context unchanged. Only tool search removes definitions from context.

      Covered in Choosing between progressive discovery and a fixed toolset

    Sources

    Every claim above is drawn from one of these pages, quoted as it was written on the date shown.

    1. 1.
      “Tool search typically reduces this by over 85 percent, loading only the 3–5 tools Claude needs for a given request.”
      ↩︎ What a monolithic toolset costs
      “Because tool search loads only a focused set of relevant tools on demand, selection accuracy stays high even across thousands of tools.”
      ↩︎ What a monolithic toolset costs
      “Never set defer_loading: true on the tool search tool itself.”
      ↩︎ How tool search works: defer_loading and tool_reference
      “Initially, Claude's context contains only the tool search tool and any non-deferred tools.”
      ↩︎ How tool search works: defer_loading and tool_reference
      “The prefix is untouched, so prompt caching is preserved.”
      ↩︎ How tool search works: defer_loading and tool_reference
      “The API expands tool_reference blocks throughout the conversation history, so Claude can reuse discovered tools in later turns without re-searching.”
      ↩︎ How tool search works: defer_loading and tool_reference
      “Never return a tool_result for its srvtoolu_... ID.”
      ↩︎ How tool search works: defer_loading and tool_reference
      “Instead of loading all tool definitions into the context window up front, Claude searches your tool catalog”
      ↩︎ Key concept
      “You still send every tool's full definition in the tools array on every request, including the deferred ones.”
      ↩︎ Exam trap 1
      “Keep your 3–5 most frequently used tools non-deferred so Claude can call them without searching first.”
      ↩︎ Exam trap 2
      “Claude's ability to pick the right tool degrades once you exceed 30–50 available tools.”
      ↩︎ Prediction
      “Context bloat: A typical multiserver setup (GitHub, Slack, Sentry, Grafana, and Splunk) can consume ~55k tokens in definitions before Claude does any work.”
      ↩︎ Checkpoint
      “The API runs the search and returns the matching tools as tool_reference blocks”
      ↩︎ Checkpoint
    2. 2.
      “Tool definitions can consume large portions of the context window (50 tools can use 10-20K tokens), leaving less room for actual work.”
      ↩︎ What a monolithic toolset costs
      “Maximum tools: 10,000 tools in your catalog”
      ↩︎ What a monolithic toolset costs
    3. 3.
      “This trades a small amount of latency (one extra turn to look up a tool) for a large reduction in baseline context usage.”
      ↩︎ Choosing between progressive discovery and a fixed toolset
      “Add tool search once your toolset grows past roughly 20 tools or your baseline context usage becomes noticeable.”
      ↩︎ Choosing between progressive discovery and a fixed toolset
      “Enable prompt caching on your tool definitions from day one.”
      ↩︎ Choosing between progressive discovery and a fixed toolset
      “Prompt caching doesn't reduce the number of tokens in context, but it reduces what you pay for them on subsequent requests.”
      ↩︎ Exam trap 3
      “This is the right choice when the toolset is large but fixed.”
      ↩︎ Checkpoint

    Continue to page 2 of 2

    Progressive disclosure in Agent Skills and Agent SDK tool search

    Spotted a mistake, or was something unclear? Tell us.