Skip to main content
Glama

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
NameRequiredDescriptionDefault
clientIdYes
idYes

Implementation Reference

  • 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"]
      }
    },
  • 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"]
    }
  • 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',
      });
    }

Latest Blog Posts

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/fellipesaraiva88/n8n-mcp-server'

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