liveBook · Manning

Deferred tool loading

As explained in Vibe Engineering

Deferred tool loading is an approach that discovers and loads tool definitions only when an agent needs a capability.

Deferred tool loading avoids paying the context cost of every tool upfront. The agent starts with a search capability, discovers a relevant tool, and loads its definition just in time. section 9.5.1

Use the technique as a disciplined response to context pressure:

  • Set a tool-definition budget before choosing an integration; 10% of the context window is offered as a reasonable ceiling. section 9.5.1
  • Keep frequently used tools permanently available, and defer tools whose usage frequency does not justify a permanent context position. section 9.5.1
  • Verify retrieval against the actual tool catalogue: independent testing found that search does not always surface the correct tool. section 9.5.1

Five servers, 58 tools

With five MCP servers and 58 visible tools, similar names caused wrong selections such as notification-send-user instead of notification-send-channel. Deferred loading reduced tool-definition tokens by 85% in reported testing; accuracy also rose from 49% to 74% on Opus 4 and from 79.5% to 88.1% on Opus 4.5, but retrieval still requires local validation. section 9.5.1

Table 9.6 Context Usage claude-sonnet-4-5
Source
Tokens
Share
System prompt
3,900 tokens
2%
MCP tools
58,400 tokens
29%
Memory files
1,200 tokens
1%
Messages
42,000 tokens
21%
Free space
94,500 tokens
47%

Use the context breakdown to see how MCP tool definitions can consume 29% of the available context before useful work begins. section 9.5.1

How Vibe Engineering covers it

How deep it goes
Explains startup search, just-in-time loading, budgeting, frequency decisions, and retrieval verification, but stops short of implementation code.
Examples
Uses five MCP servers, 58 tools, notification routing errors, token reductions, and model accuracy comparisons.
What it assumes
Assumes familiarity with tool schemas, context windows, MCP, and CLI wrappers; teaches the loading tradeoff through concrete failures and measurements.
What you can do after
Operate/configure deferred tool loading by setting a budget, selecting permanent tools, and testing retrieval against the local catalogue.
How it connects
Connects tool schemas with context windows, MCP, CLI integrations, Tool Search, and tool-selection errors.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Vibe Engineering. The section links point to the parts of the book it draws on.