{"record":{"id":"970cf1d7e0135534","repo":"n8n-io/n8n","slug":"tool-not-found-970cf1","errorCode":null,"errorMessage":"Tool not found","messagePattern":"Tool not found","errorType":"exception","errorClass":"OperationalError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/nodes-langchain/nodes/mcp/McpTrigger/McpServer.ts","lineNumber":638,"sourceCode":"\t\t\t}\n\n\t\t\tconst callId = extra.requestId ? `${extra.sessionId}_${extra.requestId}` : extra.sessionId;\n\n\t\t\ttry {\n\t\t\t\tif (!request.params?.name || !request.params?.arguments) {\n\t\t\t\t\tthrow new OperationalError('Require a name and arguments for the tool call');\n\t\t\t\t}\n\n\t\t\t\tconst toolName = request.params.name;\n\t\t\t\tconst toolArguments =\n\t\t\t\t\ttypeof request.params.arguments === 'object' && request.params.arguments !== null\n\t\t\t\t\t\t? request.params.arguments\n\t\t\t\t\t\t: {};\n\n\t\t\t\tconst tools = this.sessionManager.getTools(extra.sessionId) ?? [];\n\t\t\t\tconst requestedTool = tools.find((tool) => tool.name === toolName);\n\t\t\t\tif (!requestedTool) {\n\t\t\t\t\tthrow new OperationalError('Tool not found');\n\t\t\t\t}\n\n\t\t\t\t// Eager pre-execution credential gate: if the caller has not connected a\n\t\t\t\t// required private credential, surface the actionable connection URLs\n\t\t\t\t// (via elicitation when supported, otherwise as text) instead of\n\t\t\t\t// executing (or enqueuing) the workflow.\n\t\t\t\tconst gateResult = this.pendingGateResults[callId];\n\t\t\t\tif (gateResult && !gateResult.readyToExecute) {\n\t\t\t\t\treturn await this.handleCredentialGate(server, gateResult, callId);\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tif (this.executionCoordinator.isQueueMode()) {\n\t\t\t\t\t\tconst requestId = extra.requestId?.toString() ?? '';\n\t\t\t\t\t\tthis.storePendingResponse(extra.sessionId, requestId);\n\n\t\t\t\t\t\t// Resolve handlePostMessage so webhook can return and enqueue execution.\n\t\t\t\t\t\t// The handler continues running asynchronously, waiting for worker response.","sourceCodeStart":620,"sourceCodeEnd":656,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/nodes-langchain/nodes/mcp/McpTrigger/McpServer.ts#L620-L656","documentation":"Error \"Tool not found\" thrown in n8n-io/n8n.","triggerScenarios":"Thrown at packages/@n8n/nodes-langchain/nodes/mcp/McpTrigger/McpServer.ts:638 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}