Expand description
§toolsearch
A Rust library for searching tools across multiple MCP (Model Context Protocol) servers.
This library provides functionality to:
- Connect to multiple MCP servers
- List and search tools across servers
- Filter tools by name, description, or other criteria
§Simple Example
use toolsearch::{load_servers, simple_search};
// Load servers from config file (validates automatically)
let servers = load_servers("servers.json")?;
// Simple search - auto-detects search mode
let results = simple_search(&servers, "read file").await?;
for result in results {
println!("Found tool: {} on server: {}", result.tool_name(), result.server_name);
}§Advanced Example with Builder
use toolsearch::{load_servers, SearchBuilder};
let servers = load_servers("servers.json")?;
let results = SearchBuilder::new(servers)
.query("read,file") // Comma-separated = keyword matching
.limit(10) // Limit results
.sort_by_tool() // Sort by tool name
.search()
.await?;Re-exports§
pub use error::ToolSearchError;pub use search::load_servers;pub use search::simple_search;pub use search::SearchBuilder;
Modules§
Structs§
- Search
Criteria - Search criteria for filtering tools
- Search
Fields - Fields to search in
- Search
Options - Options for search operations
- Server
Config - Configuration for an MCP server
- Tool
Search Match - Result of a tool search
Enums§
- Search
Mode - Search mode for pattern matching
- Sort
Order - Sort order for search results
- Transport
Config - Transport configuration for connecting to MCP servers
Functions§
- list_
all_ tools - List all tools from all servers without filtering
- list_
tools_ from_ server - List all tools from a single MCP server
- list_
tools_ from_ server_ with_ timeout - List all tools from a single MCP server with timeout
- search_
tools - Search for tools across multiple MCP servers (sequential)
- search_
tools_ with_ keywords - Search tools using keywords (all must match)
- search_
tools_ with_ options - Search for tools across multiple MCP servers with options
- search_
tools_ with_ query - Convenience function to search tools with a query string
- search_
tools_ with_ regex - Search tools using regex pattern