Loading image...Kiro
  • CLI
  • Powers
  • Autonomous agent
  • Enterprise
  • Pricing
  • Docs
SIGN INDOWNLOADS
Loading image...Kiro
Loading image...Kiro
Product
  • About Kiro
  • CLI
  • Powers
  • Autonomous agent
  • Pricing
  • Downloads
For
  • Enterprise
  • Startups
  • Students
Community
  • Overview
  • Showcase
  • Discord
  • Events
Resources
  • Documentation
  • Blog
  • Changelog
  • FAQs
  • Report a bug
  • Suggest an idea
  • Billing support
Social
Site TermsLicenseResponsible AI PolicyLegalPrivacy PolicyCookie Preferences
  1. Docs
  2. CLI
  3. MCP
  4. Tool Search

Tool Search

On this page
  • When to enable Tool Search
  • Enabling Tool Search
  • Settings
  • Verifying Tool Search is active
  • How it works
  • The tool_search built-in tool
  • Parameters
  • Keyword matching
  • Next steps

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.

When to enable Tool Search

Enable Tool Search if:

  • You have 5+ MCP servers configured
  • You see context window overflow errors during long conversations
  • The /tools command shows MCP tools consuming more than 50,000 tokens total

If you only use a few MCP tools, the overhead of Tool Search may not be worth it.

Info

Tool Search requires at least one MCP server to be configured. It has no effect if you only use built-in tools.

Enabling Tool Search

Tool Search is disabled by default. Enable it via settings:

bash
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:

bash
kiro-cli settings toolSearch.minPct 0 kiro-cli settings toolSearch.minTokens 0

Settings

Configure Tool Search behavior with these settings:

SettingDefaultDescription
toolSearch.enabledfalseMaster toggle for Tool Search
toolSearch.minPct5Activate when MCP tool specs exceed this % of the context window
toolSearch.minTokens50000Activate 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.

Verifying Tool Search is active

When Tool Search is active:

  • The /tools command shows reduced token counts for MCP tools compared to when it's disabled
  • You'll see tool_search calls in the agent's tool usage when it discovers tools on demand

How it works

  1. Indexing: When MCP servers connect, all tool specs are indexed for keyword search. Each tool's name, server name, description, and parameter descriptions are tokenized.

  2. 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.

  3. 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").

  4. Activation: Matched tools are loaded and their full schemas are included in subsequent requests.

The tool_search built-in tool

Tool name: tool_search

Finds and loads MCP tools on demand. Automatically allowed without user permission prompts (read-only).

Parameters

The tool_search tool accepts the following parameters:

ParameterTypeRequiredDescription
tool_idstringOne of tool_id or queryExact tool identifier in server_name::tool_name format
querystringOne of tool_id or queryKeywords to search for matching tools
max_resultsintegerNoMaximum 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 matching

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.

Next steps

  • Built-in tools: All built-in tools including tool_search
  • Settings reference: toolSearch.* settings
  • MCP configuration: Configuring MCP servers
  • Terminal UI: Real-time shell output and tool display
Page updated: April 24, 2026
Registry
Examples