Two Search Patterns
There are two ways to use tool search, depending on who drives the discovery:- Developer-Driven
- Agent-Driven
You search, LLM gets pre-filtered tools.Your code calls
searchTools() with a natural language query, gets back a filtered Tools collection, and passes those tools to the LLM. The LLM only sees relevant tools - not the entire catalog.Best for:- Known tasks where you can predict which tools are needed
- Constrained agents with a focused scope
- When you want full control over which tools the LLM can access
| Aspect | Developer-Driven | Agent-Driven |
|---|---|---|
| Tools sent to LLM | Filtered set (5-20) | Always 2 (tool_search + tool_execute) |
| Token cost | Scales with number of tools | Constant |
| Discovery | Developer searches upfront | LLM discovers on-demand |
| Execution | Developer or framework executes | LLM calls tool_execute or framework handles it |
| Use case | Constrained, known tasks | Open-ended, exploratory |
- Why Tool Search
- How It Works
- Benchmarks
- Examples
The Problem: StackOne manages over 10,000 actions across connectors, with some containing 2,000+ actions. Loading all of them into an LLM’s context window is not practical:
- Token bloat: every tool definition consumes tokens, leaving less room for reasoning
- Accuracy drops: LLMs make worse tool selections as the candidate set grows
- Provider caps: OpenAI caps function definitions at ~128 per request
Key Features
Scales to Thousands of Tools
StackOne has 10,000+ actions. Search returns only the relevant ones for each query.
Improves Accuracy
Only relevant tools exposed per request, reducing misfires and hallucinations.
Account-Aware
Filters results to tools available for configured account IDs, respecting auth boundaries.
Framework-Ready
Returns a Tools collection with converters for OpenAI, LangChain, Vercel AI SDK, and more.
Architecture Overview
Flow:- User sends a natural language query to your AI agent
- Agent calls Search Tools to find relevant actions
- Search Tools discovers available connectors and tool schemas via MCP, then ranks actions via the Semantic Search API
- Search results are matched to MCP tool definitions, sorted by relevance
- Agent receives a ranked
Toolscollection - Agent calls
execute()on the selected tool
Quick Example
Next Steps
- Tool Search for full API reference and all three methods
- Basic Usage for fetching and executing tools
- Tool Filtering for glob pattern filtering