delete-execution
Remove a specific execution by its ID from the MCP-N8N server. Requires client ID and execution ID for precise deletion.
Instructions
Delete a specific execution by ID.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| clientId | Yes | ||
| id | Yes |
Implementation Reference
- src/index.ts:1661-1691 (handler)Handler for executing the 'delete-execution' tool. Validates client, calls N8nClient.deleteExecution(id), and returns success message with execution details or error.case "delete-execution": { const { clientId, id } = args as { clientId: string; id: number }; const client = clients.get(clientId); if (!client) { return { content: [{ type: "text", text: "Client not initialized. Please run init-n8n first.", }], isError: true }; } try { const execution = await client.deleteExecution(id); return { content: [{ type: "text", text: `Successfully deleted execution:\n${JSON.stringify(execution, null, 2)}`, }] }; } catch (error) { return { content: [{ type: "text", text: error instanceof Error ? error.message : "Unknown error occurred", }], isError: true }; } }
- src/index.ts:722-732 (registration)Registration of the 'delete-execution' tool in the ListToolsRequestSchema handler, including name, description, and input schema.name: "delete-execution", description: "Delete a specific execution by ID.", inputSchema: { type: "object", properties: { clientId: { type: "string" }, id: { type: "number" } }, required: ["clientId", "id"] } },
- src/index.ts:724-731 (schema)Input schema definition for the 'delete-execution' tool, specifying clientId (string) and id (number) as required parameters.inputSchema: { type: "object", properties: { clientId: { type: "string" }, id: { type: "number" } }, required: ["clientId", "id"] }
- src/index.ts:292-296 (helper)N8nClient helper method that performs the actual DELETE request to the n8n API endpoint /executions/{id}.async deleteExecution(id: number): Promise<N8nExecution> { return this.makeRequest<N8nExecution>(`/executions/${id}`, { method: 'DELETE', }); }