Skip to main content
Glama
mcp360

MCP360 Universal Gateway

Official
by mcp360

execute

Execute MCP tools from 100+ services through a unified gateway by specifying service, tool, and parameters for integrated operations.

Instructions

execute tool

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
serviceYes
toolYes
parametersYes

Implementation Reference

  • The async handler function that implements the core logic of the 'execute' tool: validates tool existence, calls the target tool via GatewayClient, formats results, and handles errors.
    handler: async (args: any, client: GatewayClient) => {
      try {
        // Validate that tool exists
        const tools = await client.listTools();
        const tool = tools.find(t => t.name === args.tool_name);
    
        if (!tool) {
          return {
            content: [{
              type: 'text' as const,
              text: `Tool "${args.tool_name}" not found. Use the "search" tool to discover available tools.`,
            }],
            isError: true,
          };
        }
    
        // Execute the tool
        const result = await client.callTool(args.tool_name, args.arguments || {});
    
        // Format the result
        if (result.content) {
          // MCP standard response format
          return result;
        } else if (typeof result === 'object') {
          // Convert object result to text
          return {
            content: [{
              type: 'text' as const,
              text: JSON.stringify(result, null, 2),
            }],
          };
        } else {
          // Simple value result
          return {
            content: [{
              type: 'text' as const,
              text: String(result),
            }],
          };
        }
      } catch (error) {
        return {
          content: [{
            type: 'text' as const,
            text: `Error executing tool "${args.tool_name}": ${error instanceof Error ? error.message : 'Unknown error'}`,
          }],
          isError: true,
        };
      }
    },
  • The Zod input schema defining parameters for the 'execute' tool: required 'tool_name' and optional 'arguments'.
    inputSchema: z.object({
      tool_name: z.string().describe('Name of the tool to execute (use the search tool to discover available tools)'),
      arguments: z.record(z.any()).optional().describe('Tool-specific parameters as a JSON object. Each tool has different required and optional parameters.'),
    }),
  • The complete tool definition object exported as 'executeTool', registering the tool's metadata, schema, and handler for use in an MCP-compatible framework.
    export const executeTool = {
      name: 'execute',
      description: 'Execute any tool from any connected MCP server. First use the "search" tool to discover available tools and their parameters.',
      inputSchema: z.object({
        tool_name: z.string().describe('Name of the tool to execute (use the search tool to discover available tools)'),
        arguments: z.record(z.any()).optional().describe('Tool-specific parameters as a JSON object. Each tool has different required and optional parameters.'),
      }),
      handler: async (args: any, client: GatewayClient) => {
        try {
          // Validate that tool exists
          const tools = await client.listTools();
          const tool = tools.find(t => t.name === args.tool_name);
    
          if (!tool) {
            return {
              content: [{
                type: 'text' as const,
                text: `Tool "${args.tool_name}" not found. Use the "search" tool to discover available tools.`,
              }],
              isError: true,
            };
          }
    
          // Execute the tool
          const result = await client.callTool(args.tool_name, args.arguments || {});
    
          // Format the result
          if (result.content) {
            // MCP standard response format
            return result;
          } else if (typeof result === 'object') {
            // Convert object result to text
            return {
              content: [{
                type: 'text' as const,
                text: JSON.stringify(result, null, 2),
              }],
            };
          } else {
            // Simple value result
            return {
              content: [{
                type: 'text' as const,
                text: String(result),
              }],
            };
          }
        } catch (error) {
          return {
            content: [{
              type: 'text' as const,
              text: `Error executing tool "${args.tool_name}": ${error instanceof Error ? error.message : 'Unknown error'}`,
            }],
            isError: true,
          };
        }
      },
    };
Behavior1/5

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

With no annotations provided, the description carries full responsibility for behavioral disclosure but provides none. It doesn't indicate whether this is a read or write operation, what permissions are required, what side effects might occur, or any rate limits or constraints.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

While technically concise with just two words, this is a case of harmful under-specification rather than effective brevity. The description fails to provide any meaningful information that would help an agent understand or use the tool.

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

Completeness1/5

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

For a tool with 3 required parameters, no annotations, no output schema, and 0% schema description coverage, the description is completely inadequate. It provides no information about purpose, behavior, parameters, or expected outcomes, making it impossible for an agent to use this tool correctly.

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

Parameters1/5

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

The schema has 0% description coverage for all 3 parameters (service, tool, parameters), and the description adds absolutely no information about what these parameters mean, their expected formats, or how they should be used together.

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

Purpose1/5

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

The description 'execute tool' is a tautology that merely restates the tool name without specifying what it actually does. It provides no information about the action being performed, the resources involved, or how it differs from its sibling 'search' tool.

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

Usage Guidelines1/5

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

The description offers no guidance on when to use this tool versus alternatives. There's no mention of appropriate contexts, prerequisites, or comparisons to the sibling 'search' tool, leaving the agent with no usage direction.

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/mcp360/unified-gateway-mcp'

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