Tool Search loads MCP tools on demand instead of sending every tool definition with each request. This keeps your context window clear when you have many MCP servers configured, and lets the agent discover the right tools automatically.
Enable Tool Search if:
/tools command shows MCP tools consuming more than 50,000 tokens totalIf you only use a few MCP tools, the overhead of Tool Search may not be worth it.
Tool Search is disabled by default. Enable it via settings:
kiro-cli settings toolSearch.enabled true
Once enabled, Tool Search activates automatically when MCP tool specs are large enough to benefit from deferral. The default thresholds (5% of context window or 50,000 tokens) cover most cases. To force activation whenever any MCP tools are present, set the thresholds to 0:
kiro-cli settings toolSearch.minPct 0 kiro-cli settings toolSearch.minTokens 0
Configure Tool Search behavior with these settings:
| Setting | Default | Description |
|---|---|---|
toolSearch.enabled | false | Master toggle for Tool Search |
toolSearch.minPct | 5 | Activate when MCP tool specs exceed this % of the context window |
toolSearch.minTokens | 50000 | Activate when MCP tool specs exceed this token count |
When both thresholds are set, Tool Search activates if either is exceeded (OR logic). When both thresholds are set to 0, Tool Search is always active regardless of MCP tool count.
When Tool Search is active:
/tools command shows reduced token counts for MCP tools compared to when it's disabledtool_search calls in the agent's tool usage when it discovers tools on demandIndexing: When MCP servers connect, all tool specs are indexed for keyword search. Each tool's name, server name, description, and parameter descriptions are tokenized.
Deferred tool list: Instead of full JSON schemas, the model receives a compact list of server_name::tool_name: description entries. Descriptions are truncated to 1KB.
On-demand loading: When the model needs a tool, it calls tool_search with either an exact tool_id (e.g., builder-mcp::InternalSearch) or a keyword query (e.g., "search documents").
Activation: Matched tools are loaded and their full schemas are included in subsequent requests.
Tool name: tool_search
Finds and loads MCP tools on demand. Automatically allowed without user permission prompts (read-only).
The tool_search tool accepts the following parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
tool_id | string | One of tool_id or query | Exact tool identifier in server_name::tool_name format |
query | string | One of tool_id or query | Keywords to search for matching tools |
max_results | integer | No | Maximum results to return (default: 5) |
Provide exactly one of tool_id or query, not both. Matched tools are immediately activated and available for invocation.
Keyword search uses BM25 relevance scoring. Tool names are split on casing boundaries (e.g., ReadFile → read file, read_file → read file) to improve matching. Only results above the matching threshold are returned.
The default threshold is 1.5, configurable via the KIRO_CLI_TOOL_SEARCH_MATCHING_THRESHOLD environment variable.
tool_searchtoolSearch.* settings
Tool Search