Tool Search enables progressive disclosure of tools when agents have many MCP or plugin tools, reducing context overhead and improving performance.Documentation Index
Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
Use this file to discover all available pages before exploring further.
Quick Start
How It Works
When bridge mode activates, the model sees three lightweight tools instead of potentially hundreds of MCP tool schemas:| Bridge Tool | Purpose |
|---|---|
tool_search(query, limit) | BM25 search over deferred tool names and descriptions |
tool_describe(tool_name) | Returns full OpenAI function schema for the named tool |
tool_call(tool_name, tool_args) | Executes the real tool with unwrapping for traces/hooks |
When to Use It
Use Tool Search when:- Your agent connects to 10+ MCP servers
- You have 50+ tools from plugins/integrations
- Context window usage is a concern
- LLM responses are slow due to large tool schemas
- You have fewer than 10 tools total
- All tools are frequently used core operations
- Tool discovery latency is critical
Configuration Options
| Option | Type | Default | Description |
|---|---|---|---|
enabled | Union[bool, str] | "auto" | Mode: "auto", "on", "off", True, False. Auto only activates when deferrable schema tokens cross threshold. |
threshold_pct | float | 10.0 | Percentage of model context window that deferrable schemas must occupy before auto mode kicks in. |
search_default_limit | int | 5 | Default number of results returned by tool_search. |
max_search_limit | int | 20 | Upper cap on results per tool_search call. |
core_tools | Optional[FrozenSet[str]] | None | Override the default set of tools that never defer. |
Precedence Ladder
Tool Search supports multiple configuration levels:Core vs Deferrable Tools
Core Tools (Never Defer)
These 16 essential tools always remain visible:| Category | Tools |
|---|---|
| File operations | read_file, write_file, list_files, get_file_info, copy_file, move_file, delete_file |
| Shell operations | execute_command, list_processes, kill_process, get_system_info |
| Web operations | search_web, web_search, internet_search, web_crawl, crawl_web |
| Scheduling | schedule_add, schedule_list, schedule_remove |
| Memory | store_memory, search_memory |
| Clarify | clarify |
Deferrable Tools
- MCP tools: Automatically marked with
__praisonai_deferrable__ = True - Custom tools: Add
deferrable: Trueto function metadata - MCP-prefixed: Tools starting with
mcp_
Common Patterns
MCP-Heavy Agent
For agents with many MCP servers:Force-On for Testing
Always use bridge mode for testing or high-tool-count scenarios:Custom Threshold
Adjust when bridge mode activates:Best Practices
When to Enable Tool Search
When to Enable Tool Search
Enable Tool Search when your agent has 10+ tools, especially from MCP servers. The auto mode intelligently activates only when tool schemas would consume significant context window space. For agents with 3–10 tools, the overhead isn’t worth the complexity.
Choosing the Right Threshold
Choosing the Right Threshold
The default 10% threshold works well for most scenarios. Lower it to 5-7% for aggressive context saving, or raise it to 15-20% if you prefer fewer bridge interactions. Monitor your context usage and adjust based on your model’s window size.
Writing Better Search Queries
Writing Better Search Queries
More capable models (GPT-4, Claude-3.5-Sonnet) write better tool search queries. They understand semantic relationships and can find tools by functionality rather than just name matching. Smaller models may need more explicit tool naming or descriptions.
What NOT to Enable For
What NOT to Enable For
Don’t use Tool Search for agents with fewer than 10 tools, or when all tools are frequently used core operations. The 1-2 extra round trips for cold tool access aren’t worth it for small, stable toolsets.
Trade-offs
Benefits:- Reduces context window usage by 60-80% for tool-heavy agents
- Improves LLM response speed with fewer schemas to process
- Scales to hundreds of MCP tools without context bloat
- Auto mode provides zero overhead when not needed
- Cold tool access requires 1-2 extra round trips (search → describe → call)
tool_describeresults enter conversation history, growing context- Bridge mode invalidates existing tool schemas between sessions
- Smaller models may write less effective search queries
Related
MCP Integration
Connect to Model Context Protocol servers
Allowed Tools
Filter and control tool availability

