UNPKG

@n8n/n8n-nodes-langchain

Version:
18 lines (17 loc) 1.19 kB
import { DynamicStructuredTool, type DynamicStructuredToolInput } from '@langchain/core/tools'; import type { Client } from '@modelcontextprotocol/sdk/client/index.js'; import { type IDataObject } from 'n8n-workflow'; import { z } from 'zod'; import type { McpToolIncludeMode } from './types'; import type { McpTool } from '../shared/types'; export declare function getSelectedTools({ mode, includeTools, excludeTools, tools, }: { mode: McpToolIncludeMode; includeTools?: string[]; excludeTools?: string[]; tools: McpTool[]; }): McpTool[]; export declare const getErrorDescriptionFromToolCall: (result: unknown) => string | undefined; export declare const createCallTool: (name: string, client: Client, timeout: number, onError: (error: string) => void, getAbortSignal?: () => AbortSignal | undefined) => (args: IDataObject) => Promise<{} | null>; export declare function buildMcpToolName(serverName: string, toolName: string): string; export declare function isZodObjectSchema(schema: z.ZodTypeAny): schema is z.ZodObject<z.ZodRawShape>; export declare function mcpToolToDynamicTool(tool: McpTool, onCallTool: DynamicStructuredToolInput['func']): DynamicStructuredTool;