{"record":{"id":"a0dc53e9c61c44fe","repo":"n8n-io/n8n","slug":"error-error","errorCode":null,"errorMessage":"${error.error}","messagePattern":"\\$\\{error\\.error\\}","errorType":"exception","errorClass":"NodeOperationError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/nodes-langchain/nodes/mcp/shared/runtime.ts","lineNumber":199,"sourceCode":"\t\tthrow e;\n\t}\n}\n\n/**\n * Connect to the MCP server and return the client + filtered tools, or throw a\n * `NodeOperationError` on connection failure or an empty tool list. The\n * `connectOrThrow` counterpart to {@link connectAndGetTools}.\n */\nasync function connectOrThrow(\n\tctx: IExecuteFunctions,\n\tconfig: ResolvedMcpConfig,\n\titemIndex: number,\n): Promise<{ client: Client; mcpTools: McpTool[] }> {\n\tconst node = ctx.getNode();\n\tconst { client, mcpTools, error } = await connectAndGetTools(ctx, config);\n\n\tif (error) {\n\t\tthrow new NodeOperationError(node, error.error, { itemIndex });\n\t}\n\tif (!mcpTools?.length) {\n\t\tawait client.close();\n\t\tthrow new NodeOperationError(node, 'MCP Server returned no tools', { itemIndex });\n\t}\n\n\treturn { client, mcpTools };\n}\n\n/**\n * Run the tool named in `item.json.tool` against the connected client and push\n * the result onto `returnData`. Shared by the cached and non-cached execute paths.\n */\nasync function runToolCall(opts: {\n\tctx: IExecuteFunctions;\n\tnode: INode;\n\titem: INodeExecutionData;\n\tmcpTools: McpTool[];","sourceCodeStart":181,"sourceCodeEnd":217,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/nodes-langchain/nodes/mcp/shared/runtime.ts#L181-L217","documentation":"Error \"${error.error}\" thrown in n8n-io/n8n.","triggerScenarios":"Thrown at packages/@n8n/nodes-langchain/nodes/mcp/shared/runtime.ts:199 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"}