Skip to main content
Glama

find-tools

Search for MCP tools using keywords or regex patterns to identify available tools for specific tasks. Filter results by name, description, or both, and toggle case sensitivity.

Instructions

Use this tool to find best tools by searching with keywords or regex patterns. If you don't have a specific tool for a task, this is the best way to discover what tools are available.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
caseSensitiveNoWhether the search should be case-sensitive
patternYesRegex pattern to search for in tool names and descriptions
searchInNoWhere to search: in tool names, descriptions, or bothboth

Implementation Reference

  • src/index.ts:137-175 (registration)
    Registration of the 'find-tools' tool including description, input schema reference, and handler function.
    server.tool(
      "find-tools",
      `Use this tool to find best tools by searching with keywords or regex patterns.
      If you don't have a specific tool for a task, this is the best way to discover what tools are available.
      `,
      {
        pattern: FindToolsParamsSchema.shape.pattern,
        searchIn: FindToolsParamsSchema.shape.searchIn,
        caseSensitive: FindToolsParamsSchema.shape.caseSensitive,
      },
      async (args, extra) => {
        try {
          const { pattern, searchIn, caseSensitive } = args;
          const results = await serverManager.findTools(pattern, {
            searchIn,
            caseSensitive,
          });
    
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(results, null, 2),
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Failed to find tools: ${(error as Error).message}`,
              },
            ],
            isError: true,
          };
        }
      },
    );
  • Core implementation of tool search logic in McpServerManager.findTools method, which iterates over connected servers, lists their tools, and filters using regex on name/description.
    async findTools(
      pattern: string,
      options: {
        searchIn?: "name" | "description" | "both";
        caseSensitive?: boolean;
      } = {}
    ): Promise<Record<string, any[]>> {
      const { searchIn = "both", caseSensitive = false } = options;
      const servers = this.getConnectedServers();
      
      if (servers.length === 0) {
        return {};
      }
    
      // Create regex pattern
      let regex: RegExp;
      try {
        regex = new RegExp(pattern, caseSensitive ? "" : "i");
      } catch (error) {
        throw new Error(`Invalid regex pattern: ${(error as Error).message}`);
      }
    
      const results: Record<string, any[]> = {};
    
      // Search tools in each server
      for (const serverName of servers) {
        try {
          const toolsResponse = await this.listTools(serverName);
          
          if (toolsResponse.tools && Array.isArray(toolsResponse.tools)) {
            const matchedTools = toolsResponse.tools.filter((tool: any) => {
              const nameMatch = searchIn !== "description" && tool.name && regex.test(tool.name);
              const descriptionMatch = searchIn !== "name" && tool.description && regex.test(tool.description);
              return nameMatch || descriptionMatch;
            }).map((tool: any) => ({
              name: tool.name,
              description: tool.description,
            }));
    
            if (matchedTools.length > 0) {
              results[serverName] = matchedTools;
            }
          }
        } catch (error) {
          // Include error information in results
          results[serverName] = [{
            error: `Failed to search tools: ${(error as Error).message}`
          }];
        }
      }
    
      return results;
    }
  • Zod schema defining the input parameters for the 'find-tools' tool: pattern (string), searchIn (enum), caseSensitive (boolean). Referenced in the tool registration.
    export const FindToolsParamsSchema = z.object({
      pattern: z
        .string()
        .describe("Regex pattern to search for in tool names and descriptions"),
      searchIn: z
        .enum(["name", "description", "both"])
        .optional()
        .default("both")
        .describe("Where to search: in tool names, descriptions, or both"),
      caseSensitive: z
        .boolean()
        .optional()
        .default(false)
        .describe("Whether the search should be case-sensitive"),
    });
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions searching 'in tool names and descriptions' and implies discovery functionality, but lacks details on output format, pagination, error handling, or performance considerations. For a search tool with no annotation coverage, this is a significant gap, warranting a low score.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is highly concise and well-structured: two sentences that directly state the purpose and usage guidelines without any fluff. Every sentence earns its place, making it efficient and easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (search functionality with 3 parameters), no annotations, and no output schema, the description is somewhat complete but lacks depth. It covers purpose and usage well but misses behavioral details like result format or limitations. This makes it adequate but with clear gaps, scoring a minimum viable 3.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds minimal parameter semantics beyond the schema, mentioning 'keywords or regex patterns' which loosely relates to the 'pattern' parameter. With 100% schema description coverage, the schema already documents all parameters thoroughly. The description doesn't provide additional context like examples or constraints, so it meets the baseline of 3 without adding significant value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'find best tools by searching with keywords or regex patterns.' It specifies the verb 'find' and the resource 'tools,' making it understandable. However, it doesn't explicitly differentiate from siblings like 'find-tools-in-server' or 'list-all-tools,' which limits the score to 4 instead of 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear usage context: 'If you don't have a specific tool for a task, this is the best way to discover what tools are available.' This gives a strong when-to-use guideline. However, it doesn't explicitly state when not to use it or name alternatives among the siblings, so it falls short of a perfect 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/warpdev/mcp-hub-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server