import { type ToolCallback } from '@modelcontextprotocol/sdk/server/mcp.js'; import type { INode } from 'n8n-workflow'; import type z from 'zod'; import type { Mcpauth_type } from '../../services/oauth-token-verifier-proxy.service'; import type { SUPPORTED_PRODUCTION_MCP_TRIGGERS } from './mcp.constants'; import type { WorkflowDetailsOutputSchema } from './tools/get-workflow-details.tool'; export type ToolDefinition = { name: string; config: { description?: string; inputSchema?: InputArgs; outputSchema?: z.ZodRawShape; annotations?: { title?: string; readOnlyHint?: boolean; destructiveHint?: boolean; idempotentHint?: boolean; openWorldHint?: boolean; }; }; handler: ToolCallback; }; export type RegisterToolFn = (tool: ToolDefinition) => void; export declare const SEARCH_WORKFLOWS_SORT_BY_VALUES: readonly ['updatedAt:desc', 'updatedAt:asc', 'createdAt:desc', 'createdAt:asc', 'name:asc', 'name:desc']; export type SearchWorkflowsSortBy = (typeof SEARCH_WORKFLOWS_SORT_BY_VALUES)[number]; export type SearchWorkflowsParams = { limit?: number; query?: string; projectId?: string; tags?: string[]; sortBy?: SearchWorkflowsSortBy; }; export type SearchWorkflowsItem = { id: string; name: string | null; description?: string | null; active: boolean | null; createdAt: string | null; updatedAt: string | null; triggerCount: number | null; scopes: string[]; canExecute: boolean; availableInMCP: boolean; tags: Array<{ id: string; name: string; }>; }; export type SearchWorkflowsResult = { data: SearchWorkflowsItem[]; count: number; }; export type WorkflowDetailsResult = z.infer; export type WorkflowDetailsWorkflow = WorkflowDetailsResult['workflow']; export type WorkflowDetailsNode = WorkflowDetailsWorkflow['nodes'][number]; export type JSONRPCRequest = { jsonrpc?: string; method?: string; params?: { clientInfo?: McpClientInfo; [key: string]: unknown; }; id?: string | number | null; }; export type McpClientInfo = { name?: string; version?: string; }; export type McpAppsTelemetryVariant = 'env_override' | 'variant' | 'control' | 'unassigned'; export type UserConnectedToMCPEventPayload = { user_id?: string; client_name?: string; client_version?: string; auth_type?: Mcpauth_type; mcp_connection_status: 'success' | 'error'; mcp_apps_enabled?: boolean; mcp_apps_variant?: McpAppsTelemetryVariant; mcp_canvas_groups_enabled?: boolean; error?: string; }; export type ExecuteWorkflowsInputMeta = { type: 'webhook' | 'chat' | 'schedule' | 'form'; parameter_count: number; }; export type WorkflowNotFoundReason = 'workflow_does_not_exist' | 'no_permission' | 'workflow_archived' | 'not_available_in_mcp' | 'workflow_not_active' | 'unsupported_trigger' | 'execution_not_found' | 'invalid_pin_data'; export type UserCalledMCPToolEventPayload = { user_id?: string; tool_name: string; parameters?: Record; results?: { success: boolean; data?: unknown; error?: string | Record; error_reason?: WorkflowNotFoundReason; }; }; export type N8nConnectCoverage = { credentialTypes: string[]; nodes: string[]; }; export type MCPTriggersMap = { [K in keyof typeof SUPPORTED_PRODUCTION_MCP_TRIGGERS]: INode[]; };