n8n_delete_execution
Remove execution records from n8n workflow history to manage storage and maintain clean logs.
Instructions
Delete an execution record.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The execution ID to delete |
Implementation Reference
- src/tools/execution-tools.ts:189-211 (handler)The core handler function for the 'n8n_delete_execution' tool. It validates the execution ID from input arguments, calls the N8nApiClient to delete the execution, and returns a formatted success response.n8n_delete_execution: async ( client: N8nApiClient, args: Record<string, unknown> ): Promise<ToolResult> => { const id = args.id as string; if (!id) { throw new Error('Execution ID is required'); } await client.deleteExecution(id); return { content: [ { type: 'text' as const, text: JSON.stringify({ success: true, message: `Execution ${id} deleted successfully`, }, null, 2), }, ], }; },
- src/tools/execution-tools.ts:58-71 (schema)Tool definition including the name, description, and input schema requiring a string 'id' parameter.{ name: 'n8n_delete_execution', description: 'Delete an execution record.', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'The execution ID to delete', }, }, required: ['id'], }, },
- src/server.ts:127-131 (registration)Registration and dispatching logic in the MCP server. Routes tool calls matching executionToolHandlers (including n8n_delete_execution) to the appropriate handler function with the API client.// Execution tools if (name in executionToolHandlers) { const handler = executionToolHandlers[name as keyof typeof executionToolHandlers]; return handler(client, args); }
- src/tools/index.ts:12-16 (registration)Central tool registry where executionTools (containing n8n_delete_execution definition) is combined into allTools for export to the MCP server.export const allTools: ToolDefinition[] = [ ...documentationTools, // Documentation first for discoverability ...workflowTools, ...executionTools, ];