New to tool search? Start with Tool Search 101 for an overview of why, how, and when to use it.
Agent-Driven Search (Recommended)
The simplest way to use tool search: give your agenttool_search and tool_execute, and let it discover tools on demand.
Framework Examples
Manual Search
When you need to find tools yourself before passing them to an agent:Search modes (auto, semantic, local)
Search modes (auto, semantic, local)
| Mode | Behaviour |
|---|---|
auto | Tries semantic API first, falls back to local search on failure. Recommended for production. |
semantic | Strict mode. Uses semantic API only, raises SemanticSearchError on failure. |
local | Hybrid BM25 + TF-IDF search entirely in-process (powered by bm25s). No network call. Useful for offline or low-latency scenarios. |
Constructor configuration
Constructor configuration
Set default search options at the constructor level. These apply to all search calls unless overridden per-call.
Per-call overrides take precedence over constructor defaults:
SearchConfig Options
| Option | Type | Description |
|---|---|---|
method | "auto" | "semantic" | "local" | Search mode (default: "auto") |
top_k | int | Maximum number of tools to return |
min_similarity | float | Minimum relevance score threshold (0-1) |
Parameters reference
Parameters reference
| Parameter | Type | Description |
|---|---|---|
query | str | Natural language description of what you want to do |
top_k | int | None | Maximum number of tools to return |
search | "auto" | "semantic" | "local" | Search mode (default: "auto") |
connector | str | None | Filter to a specific provider (e.g., "workday") |
min_similarity | float | None | Minimum relevance score threshold (0-1) |
account_ids | list[str] | None | Override account IDs for this search |
Advanced Patterns
search_action_names(), lightweight preview
search_action_names(), lightweight preview
Returns action IDs and similarity scores without fetching full tool definitions. Use it to inspect results before committing to a full fetch.
get_search_tool(), callable for custom agent loops
get_search_tool(), callable for custom agent loops
Returns a callable
SearchTool for agent loops where the LLM decides what to search for.