liveBook · Manning

Dynamic tool discovery

As explained in Vibe Engineering

On-demand tool discovery is a method in which an agent searches for needed capabilities and receives only matching tool definitions in its context.

Exposing every connected tool on every request creates structural context cost: unused definitions consume tokens and compete with the task for attention. Dynamic tool discovery replaces the full catalog with a search tool, allowing an agent to retrieve only definitions matching its current need. section 3.3.5

Use the technique with explicit limits:

  • Treat capability lookup as a separate problem from tool accuracy, tool selection, and result placement in context. section 3.3.5
  • Prefer matched tool definitions over an unfiltered inventory when many connected servers expose capabilities. section 3.3.5
  • Keep the broader principle in view: provide live sources of truth while carrying only task-relevant capabilities. section 3.3.5
Figure 3.5 MCP Governance layers - the agent communicates through an MCP Gateway (enforcing auth and policies), which routes to an MCP Proxy (aggregating multiple servers into a curated toolset), which connects to individual MCP servers registered in a central catalog. Each layer adds security and reduces context noise.

The governance-layer diagram shows how gateways, proxies, and curated toolsets reduce context noise while adding policy and security controls. section 3.3.5

How Vibe Engineering covers it

How deep it goes
Defines the search-based pattern and its tradeoffs, but stops short of specifying search ranking or implementation details.
Examples
Uses a search tool and contrasts it with exposing fifty tools, code execution, and CLI commands such as gh, kubectl, and psql.
What you can do after
Apply it via a search tool that injects matched definitions instead of advertising every connected capability.
How it connects
Connects tool definitions with context windows, MCP governance, code execution, and CLI-first interfaces.

Also explained in

Compare how 4 books explain dynamic tool discovery →

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.