Skip to main content
Glama

list-all-tools

Discover available tools from connected servers to identify additional capabilities for completing tasks effectively.

Instructions

List all available tools from all connected servers. Before starting any task based on the user's request, always begin by using this tool to get a list of any additional tools that may be available for use.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The asynchronous handler function that implements the logic for the 'list-all-tools' tool. It fetches tools from all connected servers via serverManager and returns a JSON stringified list or error.
    async (args, extra) => {
      try {
        const servers = serverManager.getConnectedServers();
    
        if (servers.length === 0) {
          return {
            content: [
              {
                type: "text",
                text: "No connected servers.",
              },
            ],
          };
        }
    
        const allTools: Record<string, any> = {};
    
        // Get tools list from each server
        for (const serverName of servers) {
          try {
            const toolsResponse =
              await serverManager.listTools(serverName);
            allTools[serverName] = toolsResponse;
          } catch (error) {
            allTools[serverName] = {
              error: `Failed to get tools list: ${
                (error as Error).message
              }`,
            };
          }
        }
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(allTools, null, 2),
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `Failed to get tools list from all servers: ${
                (error as Error).message
              }`,
            },
          ],
          isError: true,
        };
      }
    }
  • src/index.ts:21-80 (registration)
    The registration of the 'list-all-tools' tool on the MCP server using server.tool(), including name, description, empty schema, and inline handler.
    // Tool to return tools list from all servers
    server.tool(
      "list-all-tools",
      "List all available tools from all connected servers. Before starting any task based on the user's request, always begin by using this tool to get a list of any additional tools that may be available for use.",
      {}, // Use empty object when there are no parameters
      async (args, extra) => {
        try {
          const servers = serverManager.getConnectedServers();
    
          if (servers.length === 0) {
            return {
              content: [
                {
                  type: "text",
                  text: "No connected servers.",
                },
              ],
            };
          }
    
          const allTools: Record<string, any> = {};
    
          // Get tools list from each server
          for (const serverName of servers) {
            try {
              const toolsResponse =
                await serverManager.listTools(serverName);
              allTools[serverName] = toolsResponse;
            } catch (error) {
              allTools[serverName] = {
                error: `Failed to get tools list: ${
                  (error as Error).message
                }`,
              };
            }
          }
    
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(allTools, null, 2),
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Failed to get tools list from all servers: ${
                  (error as Error).message
                }`,
              },
            ],
            isError: true,
          };
        }
      }
    );
  • Empty schema object indicating no input parameters for the 'list-all-tools' tool.
    {}, // Use empty object when there are no parameters
Behavior3/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. It describes the tool's behavior as listing tools from all servers and suggests it should be used first in tasks, which adds useful context. However, it lacks details on potential limitations (e.g., rate limits, authentication needs, or what 'all connected servers' entails), leaving some behavioral aspects unclear.

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

Conciseness4/5

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

The description is concise and well-structured in two sentences: the first states the purpose, and the second provides usage guidelines. Every sentence adds value without redundancy. It could be slightly more front-loaded by emphasizing the 'list' action first, but overall it's efficient and clear.

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

Completeness4/5

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

Given the tool's simplicity (0 parameters, no output schema, no annotations), the description is reasonably complete. It explains what the tool does and when to use it, which suffices for this context. However, it lacks details on output format or behavioral constraints (e.g., whether it's idempotent or has side effects), preventing a perfect score.

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

Parameters4/5

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

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description appropriately does not discuss parameters, focusing instead on the tool's purpose and usage. This meets the baseline of 4 for tools with no parameters, as it avoids unnecessary details.

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: 'List all available tools from all connected servers.' It specifies the verb ('list') and resource ('tools'), and distinguishes it from the sibling tool 'call-tool' by focusing on enumeration rather than invocation. However, it doesn't explicitly differentiate from potential other listing tools beyond the sibling, keeping it at 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 Guidelines5/5

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

The description provides explicit usage guidelines: 'Before starting any task based on the user's request, always begin by using this tool to get a list of any additional tools that may be available for use.' It clearly states when to use it (at the start of tasks) and why (to discover additional tools), offering strong guidance without alternatives needed given the context.

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

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/tpavelek/mcp-hub-mcp'

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