tool_call
Execute methods from integrated tools by specifying tool name, method, and required parameters. Access multiple tools through unified VeyraX MCP authentication.
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
| Name | Required | Description | Default |
|---|---|---|---|
| tool | Yes | The name of the tool to call (e.g., 'gmail', 'google-calendar', 'slack') | |
| method | Yes | The method of the tool to call (e.g., 'get_messages', 'send_message', 'list_events') | |
| parameters | No | The parameters required by the specific tool method being called, it is MUST HAVE field. | |
| question | No | 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. |
Implementation Reference
- src/tools/tool-call.ts:26-66 (handler)The `execute` method implements the core logic of the 'tool_call' tool. It constructs a URL with the specified tool and method, sends a POST request with parameters using veyraxClient, and returns the response as formatted JSON. Includes error handling for 404 (not found) and 500 (server error) cases.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; } }
- src/tools/tool-call.ts:15-24 (schema)Zod schema defining the input structure for the 'tool_call' tool, including required fields: tool (string), method (string), parameters (object), and 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)Registration of the ToolCallTool instance with the MCP server, making the 'tool_call' tool available.new ToolCallTool().register(server);