Files
n8n-mcp/src/mcp/tool-docs/index.ts
czlonkowski 198e773bb3 feat: add n8n_generate_workflow tool for hosted workflow generation
Add new MCP tool that enables AI-powered workflow generation from natural
language descriptions. Uses handler delegation pattern — hosting environments
inject a GenerateWorkflowHandler via EngineOptions, self-hosted instances
receive a hosted-only informational response.

Handler flows through N8NMCPEngine → SingleSessionHTTPServer →
N8NDocumentationMCPServer with helpers for createWorkflow, validateWorkflow,
autofixWorkflow, and getWorkflow.

Includes full tool documentation, tests, and corrected tools overview count.

Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 12:32:31 +02:00

71 lines
2.1 KiB
TypeScript

import { ToolDocumentation } from './types';
// Import all tool documentations
import { searchNodesDoc } from './discovery';
import { getNodeDoc } from './configuration';
import { validateNodeDoc, validateWorkflowDoc } from './validation';
import { getTemplateDoc, searchTemplatesDoc } from './templates';
import {
toolsDocumentationDoc,
n8nHealthCheckDoc
} from './system';
import { aiAgentsGuide } from './guides';
import {
n8nCreateWorkflowDoc,
n8nGetWorkflowDoc,
n8nUpdateFullWorkflowDoc,
n8nUpdatePartialWorkflowDoc,
n8nDeleteWorkflowDoc,
n8nListWorkflowsDoc,
n8nValidateWorkflowDoc,
n8nAutofixWorkflowDoc,
n8nTestWorkflowDoc,
n8nExecutionsDoc,
n8nWorkflowVersionsDoc,
n8nDeployTemplateDoc,
n8nManageDatatableDoc,
n8nGenerateWorkflowDoc
} from './workflow_management';
// Combine all tool documentations into a single object
export const toolsDocumentation: Record<string, ToolDocumentation> = {
// System tools
tools_documentation: toolsDocumentationDoc,
n8n_health_check: n8nHealthCheckDoc,
// Guides
ai_agents_guide: aiAgentsGuide,
// Discovery tools
search_nodes: searchNodesDoc,
// Configuration tools
get_node: getNodeDoc,
// Validation tools
validate_node: validateNodeDoc,
validate_workflow: validateWorkflowDoc,
// Template tools
get_template: getTemplateDoc,
search_templates: searchTemplatesDoc,
// Workflow Management tools (n8n API)
n8n_create_workflow: n8nCreateWorkflowDoc,
n8n_get_workflow: n8nGetWorkflowDoc,
n8n_update_full_workflow: n8nUpdateFullWorkflowDoc,
n8n_update_partial_workflow: n8nUpdatePartialWorkflowDoc,
n8n_delete_workflow: n8nDeleteWorkflowDoc,
n8n_list_workflows: n8nListWorkflowsDoc,
n8n_validate_workflow: n8nValidateWorkflowDoc,
n8n_autofix_workflow: n8nAutofixWorkflowDoc,
n8n_test_workflow: n8nTestWorkflowDoc,
n8n_executions: n8nExecutionsDoc,
n8n_workflow_versions: n8nWorkflowVersionsDoc,
n8n_deploy_template: n8nDeployTemplateDoc,
n8n_manage_datatable: n8nManageDatatableDoc,
n8n_generate_workflow: n8nGenerateWorkflowDoc
};
// Re-export types
export type { ToolDocumentation } from './types';