Skip to main content
Glama

tool_call

Execute specific methods of various tools with required parameters using this function. Specify the tool name, method, and parameters to perform actions like sending messages or listing events.

Instructions

"Use this tool to execute a specific method of another tool with the provided parameters based on get-tools tool response. You need to specify the tool name, method name, and any required parameters for that method."

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
methodYesThe method of the tool to call (e.g., 'get_messages', 'send_message', 'list_events')
parametersNoThe parameters required by the specific tool method being called, it is MUST HAVE field.
questionNoUser question that you want find answer for. Try to ALWAYS provide this field based on conversation with user. Could be your reasoning for calling tool.
toolYesThe name of the tool to call (e.g., 'gmail', 'google-calendar', 'slack')

Implementation Reference

  • The execute method implements the core logic of the 'tool_call' tool. It constructs a URL based on the tool, method, and optional question, posts parameters to veyraxClient, returns the response as text content, and handles specific errors like 404 (not found) and 500 (server error).
    async execute({ tool, method, parameters, question }: z.infer<typeof this.schema>) { try { const url = `/tool-call/${tool}/${method}?include_component=false${question ? `&question=${encodeURIComponent(question)}` : ''}`; const { data } = await veyraxClient.post(url, parameters); return { content: [ { type: "text" as const, text: JSON.stringify(data, null, 2), }, ], }; } catch (error: any) { console.error(`Error calling tool ${tool}.${method}:`, error); if (error?.response) { if (error.response.status === 404) { return { content: [ { type: "text" as const, text: `Tool or method not found: ${tool}.${method}. Please check the tool name and method name.`, }, ], }; } else if (error.response.status === 500) { return { content: [ { type: "text" as const, text: `Server error occurred while calling ${tool}.${method}. Please try again later.`, }, ], }; } } throw error; } }
  • Zod schema defining input validation for 'tool_call': required 'tool' (string), 'method' (string), 'parameters' (record, default {}), optional 'question' (string).
    schema = z.object({ tool: z.string().describe("The name of the tool to call (e.g., 'gmail', 'google-calendar', 'slack')"), method: z.string().describe("The method of the tool to call (e.g., 'get_messages', 'send_message', 'list_events')"), parameters: z.record(z.any()) .default({}) .describe("The parameters required by the specific tool method being called, it is MUST HAVE field."), question: z.string() .optional() .describe("User question that you want find answer for. Try to ALWAYS provide this field based on conversation with user. Could be your reasoning for calling tool.") });
  • src/index.ts:14-14 (registration)
    Registers the ToolCallTool with the MCP server instance.
    new ToolCallTool().register(server);
  • Sets the name to 'tool_call' and provides the tool description within the ToolCallTool class.
    name = toolName; description = toolDescription;

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/VeyraX/veyrax-mcp'

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