Skip to main content
Glama

tools/call

Execute remote tools on AI clients like Claude and Cline through the Model Context Protocol to enable cross-client communication and functionality.

Instructions

Execute a tool on a remote MCP client

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
methodYes
argumentsYes
targetTypeNo

Implementation Reference

  • The primary handler function for the 'tools/call' tool. It logs the parameters, generates a unique message ID, constructs a request message with the provided method and arguments, creates a task for tracking, routes the message to the target client using the router, handles routing failure by updating task status and throwing an error, updates the task to 'processing', and returns a mock text response indicating success (with a TODO for full response handling).
    private async handleToolCall(params: any): Promise<any> {
      console.error('Handling tool call:', JSON.stringify(params, null, 2));
      const messageId = randomUUID();
      const message: Message = {
        id: messageId,
        type: 'request',
        method: params.method,
        sourceClientId: 'bridge-server',
        payload: params.arguments,
        timestamp: new Date()
      };
      console.error('Created message:', JSON.stringify(message, null, 2));
    
      // Create task state
      const task = this.stateManager.createTask(
        messageId,
        'bridge-server',
        this.config.maxTaskAttempts
      );
    
      // Route message
      const success = await this.router.routeMessage(message);
      if (!success) {
        this.stateManager.updateTask(messageId, {
          status: 'failed',
          error: 'Failed to route message'
        });
        throw new McpError(ErrorCode.InternalError, 'Failed to route message');
      }
    
      // Update task state
      this.stateManager.updateTask(messageId, { status: 'processing' });
    
      // TODO: Implement response waiting and timeout handling
      // For now, just return a mock response
      return {
        content: [
          {
            type: 'text',
            text: 'Message routed successfully'
          }
        ]
      };
    }
  • src/server.ts:83-97 (registration)
    Tool registration in the MCP server's capabilities object. Declares the 'tools/call' tool with its description and input schema (method, arguments, optional targetType). This makes the tool discoverable via tools/list.
    'tools/call': {
      description: 'Execute a tool on a remote MCP client',
      inputSchema: {
        type: 'object',
        properties: {
          method: { type: 'string' },
          arguments: { type: 'object' },
          targetType: {
            type: 'string',
            enum: ['claude', 'cline']
          }
        },
        required: ['method', 'arguments']
      }
    }
  • src/server.ts:125-133 (registration)
    Registration of the request handler for CallToolRequestSchema, which dispatches 'tools/call' requests to the handleToolCall method.
    this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
      if (request.params.name === 'discover_client') {
        return this.handleClientDiscovery(request.params.arguments);
      }
      if (request.params.name === 'tools/call') {
        return this.handleToolCall(request.params.arguments);
      }
      throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${request.params.name}`);
    });
  • Schema definition for 'tools/call' tool returned in response to ListToolsRequestSchema.
      name: 'tools/call',
      description: 'Execute a tool on a remote MCP client',
      inputSchema: {
        type: 'object',
        properties: {
          method: { type: 'string' },
          arguments: { type: 'object' },
          targetType: {
            type: 'string',
            enum: ['claude', 'cline']
          }
        },
        required: ['method', 'arguments']
      }
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While 'Execute a tool' implies a potentially state-changing operation, the description doesn't specify whether this is read-only or destructive, what permissions are required, whether there are rate limits, or what happens on failure. It provides minimal behavioral context beyond the basic action.

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 extremely concise at just 6 words, front-loading the core purpose with zero wasted language. Every word earns its place in communicating the essential function.

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?

For a tool with 3 parameters (2 required), 0% schema coverage, no annotations, and no output schema, the description is inadequate. It doesn't explain what the tool returns, how to interpret results, error conditions, or provide any parameter guidance. The description leaves too many open questions for effective agent use.

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

Parameters2/5

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

With 0% schema description coverage for all 3 parameters, the description provides no information about what 'method', 'arguments', or 'targetType' represent. The description doesn't explain what constitutes a valid method name, what format arguments should take, or what the 'claude'/'cline' enum values mean. It fails to compensate for the complete lack of schema 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 ('Execute a tool') and target ('on a remote MCP client'), providing a specific verb+resource combination. However, it doesn't explicitly differentiate from its sibling 'discover_client', which appears to be a different type of operation (likely discovery vs. execution).

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. There's no mention of prerequisites, appropriate contexts, or comparison with the sibling tool 'discover_client'. The agent must infer usage from the tool name and description alone.

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/glassBead-tc/SubspaceDomain'

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