Skip to main content
Glama

list-all-tools-in-server

Lists all available tools on a specified MCP server by returning their names and descriptions, simplifying tool discovery and management on the MCP Hub.

Instructions

List ALL tools from a specific MCP server (returns name and description only)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
serverNameYesName of the MCP server to list tools from

Implementation Reference

  • The tool registration and inline handler function that extracts serverName from args, calls serverManager.listToolsInServer(serverName), and returns the JSON-formatted result or error.
    server.tool(
      "list-all-tools-in-server", 
      "List ALL tools from a specific MCP server (returns name and description only)",
      {
        serverName: ListToolsInServerParamsSchema.shape.serverName,
      },
      async (args, extra) => {
        try {
          const { serverName } = args;
          const result = await serverManager.listToolsInServer(serverName);
    
          return {
            content: [
              {
                type: "text", 
                text: JSON.stringify(result, null, 2),
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error listing tools from server '${args.serverName}': ${(error as Error).message}`,
              },
            ],
          };
        }
      }
    );
  • Zod schema defining the input parameter 'serverName' for the list-all-tools-in-server tool.
    export const ListToolsInServerParamsSchema = z.object({
      serverName: z
        .string()
        .describe("Name of the MCP server to list tools from"),
    });
    
    export type ListToolsInServerParams = z.infer<
      typeof ListToolsInServerParamsSchema
    >;
  • Helper method in McpServerManager that lists tools from the specified server using client.listTools(), filters to name and description only, and returns the result.
    async listToolsInServer(serverName: string): Promise<any> {
      const client = this.getClient(serverName);
      const toolsResponse = await client.listTools();
      
      if (!toolsResponse.tools || !Array.isArray(toolsResponse.tools)) {
        return { tools: [] };
      }
    
      // Filter to only include name and description
      return {
        tools: toolsResponse.tools.map((tool: any) => ({
          name: tool.name,
          description: tool.description,
        }))
      };
    }
Behavior3/5

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

With no annotations provided, the description carries full burden. It discloses the limited return format ('name and description only'), which is valuable behavioral context. However, it doesn't mention potential limitations like pagination, error conditions, or what happens if the server doesn't exist. For a read operation with no annotations, this is adequate but not comprehensive.

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 a single, efficient sentence that communicates the core purpose, scope, and return format without any wasted words. It's appropriately sized for a simple tool and front-loads the essential information.

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?

For a simple read operation with 1 parameter (100% schema coverage) and no output schema, the description provides sufficient context about what the tool does and what it returns. The main gap is the lack of output format details beyond 'name and description only' - without an output schema, more specifics about the return structure would be helpful.

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?

Schema description coverage is 100%, so the schema already documents the single 'serverName' parameter completely. The description adds no additional parameter information beyond what's in the schema. According to scoring rules, when schema coverage is high (>80%), the baseline is 3 even with no param info in description.

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

Purpose5/5

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

The description clearly states the specific action ('List ALL tools') and resource ('from a specific MCP server'), with explicit scope ('returns name and description only'). It distinguishes from siblings like 'list-all-tools' (which presumably lists all tools across servers) by specifying 'from a specific MCP server'.

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 context for when to use this tool (to get tools from a specific server with limited fields), but doesn't explicitly mention when NOT to use it or name alternatives like 'find-tools-in-server' or 'get-tool'. The specificity about 'returns name and description only' helps differentiate use cases.

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