Skip to main content
Glama
tesla0225

MCP Create Server

by tesla0225

get-server-tools

Retrieve a list of tools available on a specified MCP server using its server ID, enabling efficient management and customization of server resources.

Instructions

Get the tools available on a server

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
serverIdYesThe ID of the server

Implementation Reference

  • Core implementation that retrieves tools from the target server by calling listTools() on its MCP client.
    async getServerTools(serverId: string): Promise<any> {
      const server = this.servers.get(serverId);
      if (!server) {
        throw new Error(`Server ${serverId} not found`);
      }
    
      try {
        // Get tools from the server using the MCP client
        const tools = await server.client.listTools();
        return tools;
      } catch (error) {
        console.error(`Error getting tools from server ${serverId}:`, error);
        throw error;
      }
    }
  • Tool dispatch handler in the main MCP server that validates input and delegates to ServerManager.getServerTools.
    case "get-server-tools": {
      const args = request.params
        .arguments as unknown as GetServerToolsArgs;
      if (!args.serverId) {
        throw new Error("Missing required argument: serverId");
      }
    
      const tools = await serverManager.getServerTools(args.serverId);
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify({ tools }),
          },
        ],
      };
    }
  • Tool schema definition including name, description, and input schema requiring serverId.
    const getServerToolsTool: Tool = {
      name: "get-server-tools",
      description: "Get the tools available on a server",
      inputSchema: {
        type: "object",
        properties: {
          serverId: {
            type: "string",
            description: "The ID of the server",
          },
        },
        required: ["serverId"],
      },
    };
  • index.ts:1011-1022 (registration)
    Registers getServerToolsTool in the list of available tools returned by ListToolsRequest.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      console.error("Received ListToolsRequest");
      return {
        tools: [
          createServerFromTemplateTool,
          executeToolTool,
          getServerToolsTool,
          deleteServerTool,
          listServersTool,
        ],
      };
    });
  • TypeScript interface defining the input arguments for the tool.
    interface GetServerToolsArgs {
      serverId: string;
    }
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 states 'Get' but does not clarify if this is a read-only operation, what permissions are required, how results are returned (e.g., list format, pagination), or potential errors. This is inadequate for a tool with no annotation coverage.

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 with no wasted words, making it easy to parse. It is appropriately sized for a simple tool, though it could benefit from more detail to improve other dimensions without sacrificing conciseness.

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

Completeness2/5

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

Given no annotations and no output schema, the description is incomplete. It does not explain what 'tools available' means (e.g., types, formats), how results are structured, or any behavioral aspects like error handling. For a tool with one parameter but lacking structured context, this is insufficient.

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 input schema has 100% description coverage, documenting the 'serverId' parameter fully. The description does not add any meaning beyond the schema, such as explaining what constitutes a valid server ID or how to obtain it. Baseline 3 is appropriate as the schema handles parameter documentation.

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 action ('Get') and resource ('tools available on a server'), making the purpose understandable. However, it does not differentiate from sibling tools like 'list-servers' or 'execute-tool', which also involve server-related operations, so it lacks specific distinction.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It does not mention prerequisites, such as needing a valid server ID, or compare it to siblings like 'list-servers' for server enumeration or 'execute-tool' for tool execution, leaving usage context unclear.

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/tesla0225/mcp-create'

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