UNPKG

n8n-nodes-explorium

Version:
28 lines 991 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getTools = void 0; const n8n_workflow_1 = require("n8n-workflow"); const utils_1 = require("./utils"); const constants_1 = require("./constants"); async function getTools() { const node = this.getNode(); const { headers } = await (0, utils_1.getAuthHeaders)(this); const client = await (0, utils_1.connectMcpClient)({ sseEndpoint: constants_1.SSE_ENDPOINT, headers, name: node.type, version: node.typeVersion, }); if (!client.ok) { throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Could not connect to your MCP server'); } const tools = await (0, utils_1.getAllTools)(client.result); return tools.map((tool) => ({ name: tool.name, value: tool.name, description: tool.description, inputSchema: tool.inputSchema, })); } exports.getTools = getTools; //# sourceMappingURL=loadOptions.js.map