@n8n/n8n-nodes-langchain
Version:
24 lines • 1.22 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CONNECT_CREDENTIALS_TOOL_NAME = void 0;
exports.createCredentialGateTool = createCredentialGateTool;
const tools_1 = require("@langchain/core/tools");
const zod_1 = require("zod");
exports.CONNECT_CREDENTIALS_TOOL_NAME = 'connect_credentials';
function createCredentialGateTool(gateResult) {
const missing = gateResult.credentials
.filter((c) => c.status !== 'configured')
.map((c) => `${c.credentialName} (${c.credentialType})`);
const tool = new tools_1.DynamicStructuredTool({
name: exports.CONNECT_CREDENTIALS_TOOL_NAME,
description: [
'The tools of this MCP server are unavailable because required credentials are not connected for your account yet:',
...missing.map((label) => `- ${label}`),
'Call this tool to receive personal connection links, then reconnect to see the available tools.',
].join('\n'),
schema: zod_1.z.object({}),
func: async () => await Promise.resolve('Credentials are now connected. List the tools again to see the available tools.'),
});
return tool;
}
//# sourceMappingURL=CredentialGateTool.js.map