Skip to main content
Glama

n8n MCP Server

MIT License
133
1,377
  • Apple
  • Linux
delete.ts1.8 kB
/** * Delete Execution Tool * * This tool deletes a specific workflow execution from n8n. */ import { BaseExecutionToolHandler } from './base-handler.js'; import { ToolCallResult, ToolDefinition } from '../../types/index.js'; import { McpError } from '@modelcontextprotocol/sdk/types.js'; import { ErrorCode } from '../../errors/error-codes.js'; /** * Handler for the delete_execution tool */ export class DeleteExecutionHandler extends BaseExecutionToolHandler { /** * Execute the tool * * @param args Tool arguments (executionId) * @returns Result of the deletion operation */ async execute(args: Record<string, any>): Promise<ToolCallResult> { return this.handleExecution(async () => { // Validate required parameters if (!args.executionId) { throw new McpError( ErrorCode.InvalidRequest, 'Missing required parameter: executionId' ); } // Store execution ID for response message const executionId = args.executionId; // Delete the execution await this.apiService.deleteExecution(executionId); return this.formatSuccess( { id: executionId, deleted: true }, `Successfully deleted execution with ID: ${executionId}` ); }, args); } } /** * Get tool definition for the delete_execution tool * * @returns Tool definition */ export function getDeleteExecutionToolDefinition(): ToolDefinition { return { name: 'delete_execution', description: 'Delete a specific workflow execution from n8n', inputSchema: { type: 'object', properties: { executionId: { type: 'string', description: 'ID of the execution to delete', }, }, required: ['executionId'], }, }; }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/leonardsellem/n8n-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server