Skip to main content
Glama

call-tool

Execute tools from any MCP server to bypass tool limits and reduce AI errors by accessing specific functionality when needed.

Instructions

Call a specific tool from a specific server

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
serverNameYesName of the MCP server to call tool from
toolNameYesName of the tool to call
toolArgsYesArguments to pass to the tool

Implementation Reference

  • Handler function that executes the 'call-tool' logic: parses arguments, calls serverManager.callTool on the specified server and tool, and returns the result as JSON or an error message.
    async (args, extra) => {
      try {
        const { serverName, toolName, toolArgs } = args;
        const result = await serverManager.callTool(
          serverName,
          toolName,
          toolArgs
        );
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(result, null, 2),
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `Tool call failed: ${
                (error as Error).message
              }`,
            },
          ],
          isError: true,
        };
      }
    }
  • Zod schema defining the input parameters for the 'call-tool' tool: serverName (string), toolName (string), toolArgs (record of unknown).
    export const CallToolParamsSchema = z.object({
      serverName: z
        .string()
        .describe("Name of the MCP server to call tool from"),
      toolName: z.string().describe("Name of the tool to call"),
      toolArgs: z
        .record(z.unknown())
        .describe("Arguments to pass to the tool"),
    });
  • src/index.ts:83-122 (registration)
    Registration of the 'call-tool' tool on the MCP server using server.tool(), specifying name, description, schema (referencing CallToolParamsSchema), and handler function.
    server.tool(
      "call-tool",
      "Call a specific tool from a specific server",
      {
        serverName: CallToolParamsSchema.shape.serverName,
        toolName: CallToolParamsSchema.shape.toolName,
        toolArgs: CallToolParamsSchema.shape.toolArgs,
      },
      async (args, extra) => {
        try {
          const { serverName, toolName, toolArgs } = args;
          const result = await serverManager.callTool(
            serverName,
            toolName,
            toolArgs
          );
    
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(result, null, 2),
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Tool call failed: ${
                  (error as Error).message
                }`,
              },
            ],
            isError: true,
          };
        }
      }
    );
  • Supporting method in McpServerManager that proxies the tool call to the underlying MCP Client instance for the given server.
    async callTool(
      serverName: string,
      toolName: string,
      args: Record<string, unknown>
    ): Promise<any> {
      const client = this.getClient(serverName);
      return await client.callTool({
        name: toolName,
        arguments: args,
      });
    }
Behavior2/5

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

With no annotations provided, the description carries full burden but only states the basic action. It lacks details on behavioral traits such as error handling, permissions needed, rate limits, or what happens when calling tools (e.g., side effects, response format). This is inadequate for a tool that interacts with other servers.

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, clear sentence with zero wasted words. It's front-loaded and efficiently conveys the core purpose without unnecessary elaboration, making it easy for an agent to parse quickly.

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 the tool's complexity (calling tools across servers with nested parameters) and lack of annotations or output schema, the description is insufficient. It doesn't address critical context like how toolArgs should be structured, error cases, or what the call returns, leaving significant gaps for agent understanding.

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 fully documents parameters (serverName, toolName, toolArgs). The description adds no additional meaning beyond the schema, such as examples or constraints, but the high coverage justifies the baseline score of 3.

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 ('Call') and target ('a specific tool from a specific server'), which is specific and unambiguous. However, it doesn't differentiate from its sibling 'list-all-tools', which serves a completely different purpose (listing vs. calling), so it misses full sibling 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?

No guidance is provided on when to use this tool versus alternatives. The description merely states what it does without indicating context, prerequisites, or comparison to the sibling tool 'list-all-tools', leaving the agent to infer usage scenarios.

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