{"record":{"id":"0fa74075d6451976","repo":"mastra-ai/mastra","slug":"tool-toolid-on-remote-mcp-server-this-name","errorCode":null,"errorMessage":"Tool '${toolId}' on remote MCP server '${this.name}' has no execute method","messagePattern":"Tool '(.+?)' on remote MCP server '(.+?)' has no execute method","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/mcp/src/client/server-proxy.ts","lineNumber":153,"sourceCode":"    if (this._cachedToolList) {\n      return this._cachedToolList.tools.find(t => t.id === toolId || t.name === toolId);\n    }\n    return this.fetchToolList().then(list => list.tools.find(t => t.id === toolId || t.name === toolId));\n  }\n\n  public async executeTool(\n    toolId: string,\n    args: any,\n    _executionContext?: { messages?: any[]; toolCallId?: string },\n  ): Promise<any> {\n    const client = await this.getClient();\n    const tools = await client.tools();\n    const tool = tools[toolId];\n    if (!tool) {\n      throw new Error(`Tool '${toolId}' not found on remote MCP server '${this.name}'`);\n    }\n    if (!tool.execute) {\n      throw new Error(`Tool '${toolId}' on remote MCP server '${this.name}' has no execute method`);\n    }\n    return tool.execute(args, _executionContext as any);\n  }\n\n  public async listResources(): Promise<{\n    resources: Array<{\n      uri: string;\n      name: string;\n      description?: string;\n      mimeType?: string;\n      _meta?: Record<string, unknown>;\n    }>;\n  }> {\n    const client = await this.getClient();\n    const resources = await client.resources.list();\n    return {\n      resources: resources.map((r: any) => ({\n        uri: r.uri,","sourceCodeStart":135,"sourceCodeEnd":171,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/mcp/src/client/server-proxy.ts#L135-L171","documentation":"After finding the tool on the remote MCP server, executeTool checks that it has an execute method before invoking it. If the tool descriptor returned by client.tools() lacks execute, this error is thrown, since the proxy cannot invoke a tool with no executable function.","triggerScenarios":"client.tools() returns a descriptor for toolId whose shape is missing execute — e.g. a malformed/older server response, a tool that is declared but not implemented, or an unexpected object type in the tools map.","commonSituations":"Remote MCP server returns non-standard tool descriptors; version mismatch between client SDK expectations and server tool schema; tools defined only as metadata (e.g. disabled or template tools).","solutions":["Inspect the raw tool descriptor from client.tools() and confirm the server implements the tool","Upgrade the MCP server (or client) so descriptors match the expected Tool shape","Invoke the tool directly via the underlying MCP client callTool if the server only supports raw protocol calls","Report/fix the server-side tool registration so it includes execute"],"exampleFix":"// before\nawait proxy.executeTool('halfBakedTool', args); // descriptor lacks execute\n// after\nconst tool = (await proxy.tools())['halfBakedTool'];\nif (typeof tool?.execute === 'function') await proxy.executeTool('halfBakedTool', args);\nelse await client.callTool({ name: 'halfBakedTool', arguments: args });","handlingStrategy":"type-guard","validationCode":"const tool = (await proxy.tools())[toolId];\nif (tool && typeof tool.execute !== 'function') throw new Error(`Tool '${toolId}' has no execute method`);","typeGuard":"function isExecutableTool(t: unknown): t is { execute: (args: unknown, ctx: unknown) => Promise<unknown> } {\n  return !!t && typeof (t as any).execute === 'function';\n}","tryCatchPattern":"try {\n  await proxy.executeTool(toolId, args);\n} catch (e) {\n  if (e instanceof Error && e.message.includes('has no execute method')) {\n    console.error(`Remote server returned a non-executable descriptor for '${toolId}'; check server SDK version`);\n  } else throw e;\n}","preventionTips":["Keep MCP client and server SDK versions aligned","Validate tool descriptors after tools() when integrating a new server","Test tool invocation against the server before production","Fall back to client.callTool for servers returning raw descriptors"],"tags":["mcp","missing-execute","client-proxy"],"backgroundTag":"tool-not-found","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}