Skip to main content
Glama

get-tool

Retrieve the complete schema, including input details, for a specific tool on any MCP server. Ensures accurate usage by requiring server name and tool name.

Instructions

Get complete schema for a specific tool from a specific server, including inputSchema. TIP: Use find-tools first to discover the tool and get the correct serverName and toolName

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
serverNameYesName of the MCP server containing the tool
toolNameYesExact name of the tool to retrieve

Implementation Reference

  • MCP tool handler for 'get-tool': extracts parameters, calls serverManager.getTool, returns formatted tool schema or error response.
    async (args, extra) => {
      try {
        const { serverName, toolName } = args;
        const tool = await serverManager.getTool(serverName, toolName);
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(tool, null, 2),
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `Error getting tool: ${(error as Error).message}`,
            },
          ],
        };
      }
    }
  • Zod schema defining the input parameters for the 'get-tool' tool: serverName and toolName.
    export const GetToolParamsSchema = z.object({
      serverName: z
        .string()
        .describe("Name of the MCP server containing the tool"),
      toolName: z
        .string()
        .describe("Exact name of the tool to retrieve"),
    });
    
    export type GetToolParams = z.infer<
      typeof GetToolParamsSchema
    >;
  • src/index.ts:178-209 (registration)
    Registration of the 'get-tool' tool on the MCP server using server.tool(), including name, description, schema reference, and handler.
    server.tool(
      "get-tool",
      "Get complete schema for a specific tool from a specific server, including inputSchema. TIP: Use find-tools first to discover the tool and get the correct serverName and toolName",
      {
        serverName: GetToolParamsSchema.shape.serverName,
        toolName: GetToolParamsSchema.shape.toolName,
      },
      async (args, extra) => {
        try {
          const { serverName, toolName } = args;
          const tool = await serverManager.getTool(serverName, toolName);
    
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(tool, null, 2),
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error getting tool: ${(error as Error).message}`,
              },
            ],
          };
        }
      }
    );
  • Helper method in McpServerManager that implements the core logic for retrieving a specific tool's schema by listing all tools and filtering by name.
    async getTool(serverName: string, toolName: string): Promise<any> {
      const client = this.getClient(serverName);
      const toolsResponse = await client.listTools();
      
      if (!toolsResponse.tools || !Array.isArray(toolsResponse.tools)) {
        throw new Error(`No tools found on server '${serverName}'`);
      }
    
      const tool = toolsResponse.tools.find((t: any) => t.name === toolName);
      
      if (!tool) {
        throw new Error(`Tool '${toolName}' not found on server '${serverName}'`);
      }
    
      return tool;
    }
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 states the tool retrieves schema information, implying a read-only operation, but does not disclose behavioral traits such as error handling, performance characteristics, or authentication requirements. The description adds basic context about the retrieval scope but lacks detailed behavioral insights.

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 front-loaded with the core purpose in the first sentence, followed by a concise tip for usage. Both sentences earn their place by providing essential information without redundancy, making it efficient and well-structured.

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 complexity (simple retrieval with 2 parameters), high schema coverage (100%), and no output schema, the description is reasonably complete. It covers purpose, usage guidelines, and parameter context, but lacks details on output format or error handling, which could be beneficial for an AI agent. It meets most needs but has minor gaps.

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 both parameters (serverName and toolName) with clear descriptions. The description adds minimal value beyond the schema by implying these parameters are needed for retrieval, but does not provide additional syntax, format details, or usage nuances. Baseline 3 is appropriate when the schema handles most of the documentation.

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 ('Get complete schema'), the resource ('a specific tool from a specific server'), and includes the scope ('including inputSchema'). It distinguishes from siblings by mentioning 'find-tools first' for discovery, making the purpose explicit and differentiated.

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 guidance on when to use this tool vs alternatives: 'Use find-tools first to discover the tool and get the correct serverName and toolName.' This directly addresses the workflow and distinguishes it from sibling tools like find-tools, which is used for discovery rather than retrieval.

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