diff --git a/CHANGELOG.md b/CHANGELOG.md index f3b3655..5e84528 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added -- **`n8n_create_data_table` MCP tool** (Issue #640): Create data tables in n8n via the REST API +- **`n8n_create_datatable` MCP tool** (Issue #640): Create data tables in n8n via the REST API - `N8nApiClient.createDataTable()` calling `POST /data-tables` - Zod-validated handler with `N8nApiError` handling for structured error responses - TypeScript interfaces matching the n8n OpenAPI spec (`DataTableColumn`, `DataTableColumnResponse`, `DataTable`) @@ -23,7 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed -- **Health check management tool count**: Updated from 13 to 14 to include `n8n_create_data_table` +- **Health check management tool count**: Updated from 13 to 14 to include `n8n_create_datatable` Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en diff --git a/src/mcp/handlers-n8n-manager.ts b/src/mcp/handlers-n8n-manager.ts index 19d4c94..96507fe 100644 --- a/src/mcp/handlers-n8n-manager.ts +++ b/src/mcp/handlers-n8n-manager.ts @@ -1975,7 +1975,7 @@ export async function handleDiagnostic(request: any, context?: InstanceContext): // Check which tools are available const documentationTools = 7; // Base documentation tools (after v2.26.0 consolidation) - const managementTools = apiConfigured ? 14 : 0; // Management tools requiring API (includes n8n_create_data_table) + const managementTools = apiConfigured ? 14 : 0; // Management tools requiring API (includes n8n_create_datatable) const totalTools = documentationTools + managementTools; // Check npm version diff --git a/src/mcp/server.ts b/src/mcp/server.ts index d46326a..8670c90 100644 --- a/src/mcp/server.ts +++ b/src/mcp/server.ts @@ -1496,7 +1496,7 @@ export class N8NDocumentationMCPServer { if (!this.repository) throw new Error('Repository not initialized'); return n8nHandlers.handleDeployTemplate(args, this.templateService, this.repository, this.instanceContext); - case 'n8n_create_data_table': + case 'n8n_create_datatable': this.validateToolParams(name, args, ['name']); return n8nHandlers.handleCreateDataTable(args, this.instanceContext); diff --git a/src/mcp/tool-docs/index.ts b/src/mcp/tool-docs/index.ts index 86993d3..1fd2088 100644 --- a/src/mcp/tool-docs/index.ts +++ b/src/mcp/tool-docs/index.ts @@ -62,7 +62,7 @@ export const toolsDocumentation: Record = { n8n_executions: n8nExecutionsDoc, n8n_workflow_versions: n8nWorkflowVersionsDoc, n8n_deploy_template: n8nDeployTemplateDoc, - n8n_create_data_table: n8nCreateDataTableDoc + n8n_create_datatable: n8nCreateDataTableDoc }; // Re-export types diff --git a/src/mcp/tool-docs/workflow_management/n8n-create-data-table.ts b/src/mcp/tool-docs/workflow_management/n8n-create-data-table.ts index 5cd1b96..482fff1 100644 --- a/src/mcp/tool-docs/workflow_management/n8n-create-data-table.ts +++ b/src/mcp/tool-docs/workflow_management/n8n-create-data-table.ts @@ -1,12 +1,12 @@ import { ToolDocumentation } from '../types'; export const n8nCreateDataTableDoc: ToolDocumentation = { - name: 'n8n_create_data_table', + name: 'n8n_create_datatable', category: 'workflow_management', essentials: { description: 'Create a new data table in n8n. Requires n8n enterprise or cloud with the data tables feature enabled.', keyParameters: ['name', 'columns'], - example: 'n8n_create_data_table({name: "Contacts", columns: [{name: "email", type: "string"}]})', + example: 'n8n_create_datatable({name: "Contacts", columns: [{name: "email", type: "string"}]})', performance: 'Fast (100-300ms)', tips: [ 'Available column types: string, number, boolean, date, json', @@ -27,9 +27,9 @@ export const n8nCreateDataTableDoc: ToolDocumentation = { }, returns: 'Object with id and name of the created data table on success.', examples: [ - 'n8n_create_data_table({name: "Orders"}) - Create table without columns', - 'n8n_create_data_table({name: "Contacts", columns: [{name: "email", type: "string"}, {name: "score", type: "number"}]}) - Create table with typed columns', - 'n8n_create_data_table({name: "Events", columns: [{name: "payload", type: "json"}, {name: "occurred_at", type: "date"}]})' + 'n8n_create_datatable({name: "Orders"}) - Create table without columns', + 'n8n_create_datatable({name: "Contacts", columns: [{name: "email", type: "string"}, {name: "score", type: "number"}]}) - Create table with typed columns', + 'n8n_create_datatable({name: "Events", columns: [{name: "payload", type: "json"}, {name: "occurred_at", type: "date"}]})' ], useCases: [ 'Persist structured workflow data across executions', diff --git a/src/mcp/tools-n8n-manager.ts b/src/mcp/tools-n8n-manager.ts index ace240a..56c8e3a 100644 --- a/src/mcp/tools-n8n-manager.ts +++ b/src/mcp/tools-n8n-manager.ts @@ -608,7 +608,7 @@ export const n8nManagementTools: ToolDefinition[] = [ }, }, { - name: 'n8n_create_data_table', + name: 'n8n_create_datatable', description: 'Create a new data table in n8n. Requires n8n enterprise or cloud with data tables feature.', inputSchema: { type: 'object', diff --git a/tests/unit/mcp/handlers-n8n-manager.test.ts b/tests/unit/mcp/handlers-n8n-manager.test.ts index 2b6dbf3..1207078 100644 --- a/tests/unit/mcp/handlers-n8n-manager.test.ts +++ b/tests/unit/mcp/handlers-n8n-manager.test.ts @@ -1102,10 +1102,10 @@ describe('handlers-n8n-manager', () => { enabled: true, }, managementTools: { - count: 13, + count: 14, enabled: true, }, - totalAvailable: 20, + totalAvailable: 21, }, }); diff --git a/tests/unit/mcp/parameter-validation.test.ts b/tests/unit/mcp/parameter-validation.test.ts index a76c57b..ebe183e 100644 --- a/tests/unit/mcp/parameter-validation.test.ts +++ b/tests/unit/mcp/parameter-validation.test.ts @@ -542,8 +542,8 @@ describe('Parameter Validation', () => { await expect(server.testExecuteTool('n8n_test_workflow', {})) .rejects.toThrow('Missing required parameters for n8n_test_workflow: workflowId'); - await expect(server.testExecuteTool('n8n_create_data_table', {})) - .rejects.toThrow('Missing required parameters for n8n_create_data_table: name'); + await expect(server.testExecuteTool('n8n_create_datatable', {})) + .rejects.toThrow('Missing required parameters for n8n_create_datatable: name'); for (const tool of n8nToolsWithRequiredParams) { await expect(server.testExecuteTool(tool.name, tool.args))