feat: add n8n_create_data_table MCP tool and projectId for create workflow (#640)

Add new MCP tool to create n8n data tables via the REST API:
- n8n_create_data_table tool definition with name + columns schema
- handleCreateDataTable handler with Zod validation and N8nApiError handling
- N8nApiClient.createDataTable() calling POST /data-tables
- DataTable, DataTableColumn, DataTableColumnResponse types per OpenAPI spec
- Column types: string | number | boolean | date | json
- Input validation: .min(1) on table name and column names
- Tool documentation with examples, use cases, and pitfalls

Also adds projectId parameter to n8n_create_workflow for enterprise
project support, and fixes stale management tool count in health check.

Based on work by @djakielski in PR #646.
Co-Authored-By: Dominik Jakielski <dominik.jakielski@urlaubsguru.de>

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

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
czlonkowski
2026-03-20 18:13:39 +01:00
parent 47a1cb135d
commit 4a9e3c7ec0
14 changed files with 541 additions and 6 deletions

View File

@@ -63,6 +63,10 @@ export const n8nManagementTools: ToolDefinition[] = [
executionTimeout: { type: 'number' },
errorWorkflow: { type: 'string' }
}
},
projectId: {
type: 'string',
description: 'Optional project ID to create the workflow in (enterprise feature)'
}
},
required: ['name', 'nodes', 'connections']
@@ -602,5 +606,38 @@ export const n8nManagementTools: ToolDefinition[] = [
destructiveHint: false,
openWorldHint: true,
},
}
},
{
name: 'n8n_create_data_table',
description: 'Create a new data table in n8n. Requires n8n enterprise or cloud with data tables feature.',
inputSchema: {
type: 'object',
properties: {
name: { type: 'string', description: 'Name for the data table' },
columns: {
type: 'array',
description: 'Column definitions',
items: {
type: 'object',
properties: {
name: { type: 'string', description: 'Column name' },
type: {
type: 'string',
enum: ['string', 'number', 'boolean', 'date', 'json'],
description: 'Column data type',
},
},
required: ['name'],
},
},
},
required: ['name'],
},
annotations: {
title: 'Create Data Table',
readOnlyHint: false,
destructiveHint: false,
openWorldHint: true,
},
},
];