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

    Domain 3 · Lesson 19/38

    Progressive discovery vs. monolithic context: tool search and when to use it

    Evaluate progressive discovery vs. monolithic context strategy

    17 min read
    2.38% of exam
    6 sources
    Published 19 Oct 2026
    Docs as of 14 Oct 2026

    What you will be able to do

    • Quantify the per-request cost of loading every tool definition up front, and name the tool count where selection accuracy starts to slip
    • Configure tool search with defer_loading and explain how tool_reference blocks bring deferred tools into context
    • Set ENABLE_TOOL_SEARCH in the Agent SDK and predict when each value loads tools up front
    • Choose between a fixed tool set, tool search, Skills and a hybrid for a given agent, weighing search round-trips against context saved

    Key concept

    Progressive discovery — Only lightweight entry points stay in context, such as a search tool or a Skill's name and description. Full definitions and instructions load when a request needs them. A monolithic strategy does the opposite: it loads everything on every request, whether or not that request uses it.

    1.What a monolithic tool set costs before any work starts

    A monolithic context strategy puts every tool definition into the context window on every request. That is the baseline that progressive discovery is measured against. Tool definitions count toward the context window just as messages do. The full cost of carrying too many tools is covered in Capability bloat: what too many tools cost. The angle here is how large that fixed cost gets. A typical multiserver setup that connects GitHub, Slack, Sentry, Grafana and Splunk can use about 55k tokens on definitions before Claude does anything useful. The Agent SDK documentation gives a smaller rule of thumb: 50 tools can take 10–20K tokens.

    Tokens are only half of the cost. Claude's ability to pick the right tool degrades once more than 30–50 tools are available at the same time. An agent that worked well with two MCP servers can start choosing the wrong tool after a third or fourth server is connected, even though no single tool changed. Context rot adds to this. As the token count grows, accuracy and recall both decline, so a large block of mostly unused definitions also makes everything else in the window harder to use.

    A larger context window does not fix either problem. More room lets the 55k tokens fit, but it does not restore selection accuracy, and context rot gets worse as the window fills. What matters is how much is in context, not how much space is left over.

    Checkpoint 1 of 9· Check yourself

    An agent connected to GitHub, Slack, Sentry, Grafana and Splunk MCP servers loads every tool definition up front, which is about 55k tokens. Since the last two servers were added, it often calls the wrong tool. A teammate suggests switching to a model with a much larger context window. What happens?

    Checkpoint 2 of 9· Exam question

    During testing, an engineering team notices that Claude increasingly selects the wrong tool as more MCP servers are connected to their agent. At what approximate number of simultaneously loaded tools does tool selection accuracy begin to noticeably degrade?

    Sources123

    2.How tool search keeps deferred tools out of context

    Tool search is the API's progressive-discovery mechanism for tools. It replaces the monolithic catalogue with a search step. Tool search typically cuts the definition footprint by over 85 percent, loading only the 3–5 tools a given request needs. Because Claude chooses from a short, relevant list, selection accuracy stays high even when the catalogue holds thousands of tools.

    Tool search comes in two variants. With the regex variant (tool_search_tool_regex_20251119), Claude writes regex patterns. With the BM25 variant (tool_search_tool_bm25_20251119), Claude writes natural-language queries. Both search tool names, descriptions, argument names and argument descriptions, so well-written descriptions are what make a tool findable. To enable tool search, add one of the variants to the tools list and mark the tools that should stay out of context with defer_loading: true.

    A tool marked for on-demand loadingjson
    {
      "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"]
      },
      "defer_loading": true
    }

    defer_loading decides what goes into Claude's context window, not what goes into the request. At the start, Claude's context holds only the search tool and any tools that are not deferred. When Claude needs something else, it calls the search tool. The search runs on Anthropic's servers and returns the matching tools as tool_reference blocks, five by default. Claude can set a limit between 1 and 10,000. The API then expands each reference into the full tool definition before Claude sees it. You never do the expansion yourself.

    The search call and its tool_reference result inside an assistant responsejson
        {
          "type": "server_tool_use",
          "id": "srvtoolu_01ABC123",
          "name": "tool_search_tool_regex",
          "input": {
            "pattern": "weather",
            "limit": 10
          }
        },
        {
          "type": "tool_search_tool_result",
          "tool_use_id": "srvtoolu_01ABC123",
          "content": {
            "type": "tool_search_tool_search_result",
            "tool_references": [{ "type": "tool_reference", "tool_name": "get_weather" }]
          }
        }

    The conversation loop has a few rules that are easy to break:

    • Send the assistant content back unchanged, including the server_tool_use and tool_search_tool_result blocks.
    • Never return a tool_result for the srvtoolu_... ID. The API rejects the request.
    • Execute the discovered tool's ordinary tool_use and return its tool_result as normal.
    • Expect an empty tool_references array, not an error, when a search matches nothing.

    Discovered tools stay available after they are found. The API expands tool_reference blocks throughout the conversation history, so Claude can call a tool again in later turns without searching for it again. Deferred tools are also left out of the system-prompt prefix, and their references are added inline. The prefix therefore does not change and prompt caching keeps working. At least one tool, normally the search tool itself, must stay non-deferred. Never set defer_loading: true on the search tool.

    Checkpoint 3 of 9· Fill the gap

    This tool definition is sent in the tools array alongside a tool search tool. Which property keeps the tool out of Claude's context window 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
    }

    Checkpoint 4 of 9· Check yourself

    Claude's response holds three blocks: a server_tool_use block with ID srvtoolu_01ABC123, the tool_search_tool_result for that call, and a tool_use block calling get_weather with ID toolu_01XYZ789. What should your next request contain?

    Sources1

    In the Agent SDK, tool search is set by the ENABLE_TOOL_SEARCH environment variable, which you pass through the env option. On Claude Opus 4.5, Sonnet 4.5, Haiku 4.5 and later models, tool search is on by default. This matters when you connect a large MCP server: its tools are deferred automatically unless you choose otherwise. Each value decides whether definitions are deferred or loaded up front.

    ENABLE_TOOL_SEARCH values and what each one does
    ValueBehavior
    (unset)Tool search on; definitions deferred. Falls back to loading up front on older models, a non-first-party ANTHROPIC_BASE_URL, or a Microsoft Foundry deployment hosted on Azure
    trueKeeps tool search on even with a non-first-party ANTHROPIC_BASE_URL; requests fail on proxies that don't support tool_reference blocks
    autoActivates only when deferrable definitions reach 10% of the model's context window; below that, everything loads up front
    auto:NSame as auto with a custom threshold; auto:5 activates at 5%
    falseOff; all tool definitions loaded into context on every turn

    auto turns the choice between strategies into a measured threshold. It counts the tokens in the deferrable definitions and compares the total with the model's context window. A small tool set therefore stays monolithic, and a growing one switches to search without a code change. A lower N switches sooner. false forces the monolithic strategy on every turn. In the SDK, a catalogue can hold up to 10,000 tools, and each search returns the five most relevant by default.

    Checkpoint 5 of 9· Match them up

    Match each ENABLE_TOOL_SEARCH value to how the Agent SDK then treats tool definitions.

    Tap a term, then the definition that fits it.

    Sources2

    4.Choosing progressive discovery or a fixed tool set

    The rule of thumb is to load a small, frequently used tool set up front and to use progressive discovery for large or rarely used catalogues. The cost of tool search is latency: Claude needs one extra turn to look up a tool before calling it. In return, baseline context usage drops sharply. That trade pays off for toolsets of about 20 or more tools where most aren't needed on every turn. It does not pay off when every tool is used constantly.

    Matching the loading strategy to the tool set
    SituationStrategyReason
    A handful of tools, nearly all used on almost every requestLoad all up front (no tool search)A search round-trip would precede calls to tools Claude needs anyway, and little context is saved
    Roughly 20+ tools, most idle on any given turnTool search with defer_loading on the long tailLarge cut in baseline context for one extra lookup turn
    Large catalogue with a few heavy-use toolsTool search, with the 3–5 most frequent tools non-deferredCommon calls skip the search; rare tools stay out of context
    Large but fixed toolset across many requestsPrompt caching (alone or with tool search)Reduces what you pay for repeated definitions, not how many tokens sit in context

    Take an internal agent with seven tools, about 1,200 tokens of definitions, and nearly every tool used on every request. Deferring those tools would add a search before calls Claude was always going to make, to save tokens that barely register. Keep them all loaded. The guidance to keep the 3–5 most-used tools non-deferred points the same way: whenever a tool is likely to be needed, it belongs in context.

    The 55k-token multiserver agent is the opposite case. Tool search is the fix there, because it is the only option that removes definitions from context. Prompt caching makes repeated definitions cheaper, but every token still sits in context and the agent still chooses among dozens of tools. Rewriting every description by hand shrinks the definitions somewhat, but it leaves the tool count as it was and makes search worse, because names and descriptions are exactly what the search matches against. The approaches can be combined: tool search keeps the set lean, and caching lowers the cost of what stays loaded.

    Checkpoint 6 of 9· Match them up

    For each tool set, pick the loading strategy that the trade-off between search latency and context size favours.

    Tap a term, then the definition that fits it.

    Checkpoint 7 of 9· 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?

    Checkpoint 8 of 9· 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?

    Sources41

    5.Skills and hybrid loading as other forms of progressive discovery

    Tool search is not the only way to load context on demand. Agent Skills do the same thing for instructions and reference material. Skills load in three levels, described in Progressive disclosure in Skills (three loading levels): metadata at startup, then the SKILL.md body when the Skill triggers, then bundled files when they are read. What matters for this choice is the always-on cost. Each Skill keeps about 100 tokens of name and description in the system prompt, so many Skills can be installed without paying for content nobody is using.

    Tool search and Skills solve different problems. Tool search defers tool schemas, and the API finds and expands them through tool_reference blocks. Skills defer know-how: workflows, schemas and scripts. Claude reads them from a filesystem with bash, and only a script's output enters context, never its code. A large catalogue of actions points to tool search. A large body of procedures and reference documents points to Skills. Skills need the code execution environment to work. Tool search needs a model that supports it, and Claude Opus 4.1 and earlier do not.

    A hybrid often works best. Claude Code puts CLAUDE.md files into context up front and uses glob and grep to pull in other files only when they are needed. On-demand exploration has a cost of its own: it is slower than reading data that was retrieved in advance, and an agent with poor guidance can waste context on dead ends. So load what nearly every request needs, and defer the rest.

    Checkpoint 9 of 9· Check yourself

    A compliance team wants its agent to follow about 60 internal procedures. Each one has a written workflow, a reference schema and a validation script, but any single request uses only one or two of them. Which approach keeps the always-on context cost lowest while still giving Claude the procedures when it needs them?

    Sources516

    Sources

    (6)

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

    1. 1.
      “A typical multiserver setup (GitHub, Slack, Sentry, Grafana, and Splunk) can consume ~55k tokens in definitions before Claude does any work.”
      ↩︎ What a monolithic tool set costs before any work starts
      “Claude's ability to pick the right tool degrades once you exceed 30–50 available tools.”
      ↩︎ What a monolithic tool set costs before any work starts
      “Tool search typically reduces this by over 85 percent, loading only the 3–5 tools Claude needs for a given request.”
      ↩︎ How tool search keeps deferred tools out of context
      “BM25 (tool_search_tool_bm25_20251119): Claude uses natural language queries to search for tools.”
      ↩︎ How tool search keeps deferred tools out of context
      “Initially, Claude's context contains only the tool search tool and any non-deferred tools.”
      ↩︎ How tool search keeps deferred tools out of context
      “The API runs the search and returns the matching tools as tool_reference blocks”
      ↩︎ How tool search keeps deferred tools out of context
      “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 keeps deferred tools out of context
      “The prefix is untouched, so prompt caching is preserved.”
      ↩︎ How tool search keeps deferred tools out of context
      “A search that matches nothing returns a tool_search_tool_search_result with an empty tool_references array, not an error.”
      ↩︎ How tool search keeps deferred tools out of context
      “Keep your 3–5 most frequently used tools non-deferred so Claude can call them without searching first.”
      ↩︎ Choosing progressive discovery or a fixed tool set
      “Claude Opus 4.1 and earlier models don't support the tool search tool.”
      ↩︎ Skills and hybrid loading as other forms of progressive discovery
      “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 2
      “Keep your 3–5 most frequently used tools non-deferred so Claude can call them without searching first.”
      ↩︎ Exam trap 3
      “You still send every tool's full definition in the tools array on every request, including the deferred ones.”
      ↩︎ Prediction
      “On the next request, pass the assistant's content back unchanged, including the server_tool_use and tool_search_tool_result blocks.”
      ↩︎ Checkpoint
    2. 2.
      “Claude Opus 4.5, Sonnet 4.5, Haiku 4.5, and later: tool search is on by default.”
      ↩︎ Turning tool search on in the Agent SDK with ENABLE_TOOL_SEARCH
      “Tool search is off. All tool definitions are loaded into context on every turn.”
      ↩︎ Turning tool search on in the Agent SDK with ENABLE_TOOL_SEARCH
      “Maximum tools: 10,000 tools in your catalog”
      ↩︎ Turning tool search on in the Agent SDK with ENABLE_TOOL_SEARCH
      “When the total reaches 10% of the window, tool search activates.”
      ↩︎ Exam trap 4
      “When the total reaches 10% of the window, tool search activates. Below that, the SDK loads every tool definition into context upfront.”
      ↩︎ Checkpoint
    3. 3.
      “As token count grows, accuracy and recall degrade, a phenomenon known as context rot.”
      ↩︎ What a monolithic tool set costs before any work starts
      “A larger context window allows the model to handle more complex and lengthy prompts, but more context isn't automatically better.”
      ↩︎ Checkpoint
    4. 4.
      “This trades a small amount of latency (one extra turn to look up a tool) for a large reduction in baseline context usage.”
      ↩︎ Choosing progressive discovery or a fixed tool set
      “Large toolsets (20+ tools) where most tools aren't needed every turn”
      ↩︎ Choosing progressive discovery or a fixed tool set
      “Prompt caching doesn't reduce the number of tokens in context, but it reduces what you pay for them on subsequent requests.”
      ↩︎ Exam trap 1
      “Prompt caching doesn't reduce the number of tokens in context, but it reduces what you pay for them on subsequent requests.”
      ↩︎ Checkpoint
    5. 5.
      “This lightweight approach means you can install many Skills without context penalty: until a Skill is triggered, only its name and description occupy context.”
      ↩︎ Skills and hybrid loading as other forms of progressive discovery
      “Prerequisites: Using Skills through the API requires the code execution tool, whose container Skills run in.”
      ↩︎ Skills and hybrid loading as other forms of progressive discovery
    6. 6.

    Ready to test yourself?

    Practise the 12 questions on this subdomain.

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