import type { ToolSummary } from '../../../shared/models/tool.model.js'; import type { RequestOptions } from './types.js'; /** * Search options for server searches. */ export interface SearchOptions { searchIn?: 'name' | 'description' | 'both'; caseSensitive?: boolean; } /** * Finds servers matching a specified regex pattern. * * This method searches through all configured servers using the provided regex pattern, * supporting flexible search options including case sensitivity and search scope * (name, description, or both). It returns an array of matching server names. * * @param {string} pattern - Regex pattern to search for in server names and descriptions * @param {'name' | 'description' | 'both'} [searchIn='both'] - Where to perform the search * @param {boolean} [caseSensitive=false] - Whether the search should be case-sensitive * @returns {Promise} Array of matching server names * * @example * ```typescript * // Find servers with 'api' in their name (case-insensitive) * const apiServers = await findServers('api'); * * // Find servers with exact case match * const exactMatch = await findServers('^MyServer$', 'name', true); * ``` */ export declare function findServers(pattern: string, searchIn?: 'name' | 'description' | 'both', caseSensitive?: boolean): Promise; /** * Finds tools matching a pattern within a specific MCP server. * * This method searches through all tools available from the specified server using * the provided regex pattern, supporting flexible search options including case * sensitivity and search scope (name, description, or both). It returns matching * tools grouped by server name. * * @param {string} serverName - Name of the MCP server to search tools in * @param {string} pattern - Regex pattern to search for in tool names and descriptions * @param {'name' | 'description' | 'both'} [searchIn='both'] - Where to perform the search * @param {boolean} [caseSensitive=false] - Whether the search should be case-sensitive * @param {RequestOptions} [requestOptions] - Optional request options for instance selection * @returns {Promise<{ serverName: string; tools: ToolSummary[] }>} Object containing server name and matching tools * @throws {Error} If the specified server is not found or not connected * * @example * ```typescript * const result = await findToolsInServer('my-mcp-server', 'list'); * console.log(`Found ${result.tools.length} tools matching 'list'`); * ``` */ export declare function findToolsInServer(serverName: string, pattern: string, searchIn?: 'name' | 'description' | 'both', caseSensitive?: boolean, requestOptions?: RequestOptions): Promise<{ serverName: string; tools: ToolSummary[]; }>; /** * Finds tools matching a pattern across all connected MCP servers. * * This method searches through all available tools from all connected servers using the * provided regex pattern, supporting flexible search options including case sensitivity * and search scope (name, description, or both). It returns matching tools grouped by * their originating server names. * * @param {string} pattern - Regex pattern to search for in tool names and descriptions * @param {'name' | 'description' | 'both'} [searchIn='both'] - Where to perform the search * @param {boolean} [caseSensitive=false] - Whether the search should be case-sensitive * @param {() => Promise>} listAllToolsFn - Function to list all tools * @returns {Promise>} Object mapping server names to matching tools * * @example * ```typescript * const matchingTools = await findTools('list'); * Object.entries(matchingTools).forEach(([serverName, { tools }]) => { * console.log(`${serverName}: ${tools.length} matching tools`); * }); * ``` */ export declare function findTools(pattern: string, searchIn: "name" | "description" | "both" | undefined, caseSensitive: boolean | undefined, listAllToolsFn: () => Promise>): Promise>; //# sourceMappingURL=tool-search.d.ts.map