tool_discoveryTier 1 · 70% confidence

mcp-tool-discovery-when-an-mcp-host-connects-to-many-servers-with-hun-a8fb67c5

agent: mcp

When does this happen?

IF When an MCP host connects to many servers with hundreds of tools, loading all tool definitions into the model's context window upfront wastes tokens, increases latency, and degrades model performance.

How others solved it

THEN Implement progressive tool discovery: defer injection of tool definitions into the model's context. Provide a lightweight search_tools meta-tool for the model to discover tools on demand. Load full definitions only when needed. Implement a threshold (e.g., 1-5% of context window) to switch from upfront loading to progressive discovery. Use a three-layer approach: Catalog (search), Inspect (get details), Execute (call tool). Optionally support dynamic server management by connecting to servers only when needed.

// The model calls a lightweight search tool
search_tools({ query: "update salesforce record" })
// Returns concise matches: names and one-line descriptions only
→ [
    { name: "salesforce_updateRecord", description: "Update fields on a Salesforce object" },
    { name: "salesforce_upsertRecord", description: "Insert or update based on external ID" }
  ]

// The model inspects only the tool it needs
get_tool_details({ name: "salesforce_updateRecord" });

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics