Skip to main content
Glama

delete-workflow

Remove a specific workflow by ID using a single-line JSON input. Ensures immediate and irreversible deletion of the workflow from the MCP-N8N server.

Instructions

Delete a workflow by ID. This action cannot be undone. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
clientIdYes
idYes

Implementation Reference

  • Handler for the 'delete-workflow' tool call. Retrieves the N8nClient by clientId, calls deleteWorkflow(id), and returns success or error message.
    case "delete-workflow": {
      const { clientId, id } = args as { clientId: string; id: string };
      const client = clients.get(clientId);
      if (!client) {
        return {
          content: [{
            type: "text",
            text: "Client not initialized. Please run init-n8n first.",
          }],
          isError: true
        };
      }
    
      try {
        const workflow = await client.deleteWorkflow(id);
        return {
          content: [{
            type: "text",
            text: `Successfully deleted workflow:\n${JSON.stringify(workflow, null, 2)}`,
          }]
        };
      } catch (error) {
        return {
          content: [{
            type: "text",
            text: error instanceof Error ? error.message : "Unknown error occurred",
          }],
          isError: true
        };
      }
    }
  • Input schema defining parameters for the delete-workflow tool: clientId and id, both required strings.
    inputSchema: {
      type: "object",
      properties: {
        clientId: { type: "string" },
        id: { type: "string" }
      },
      required: ["clientId", "id"]
    }
  • src/index.ts:471-482 (registration)
    Registration of the 'delete-workflow' tool in the list of available tools returned by ListToolsRequestHandler.
    {
      name: "delete-workflow",
      description: "Delete a workflow by ID. This action cannot be undone. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.",
      inputSchema: {
        type: "object",
        properties: {
          clientId: { type: "string" },
          id: { type: "string" }
        },
        required: ["clientId", "id"]
      }
    },
  • Helper method in N8nClient class that makes the DELETE API request to /workflows/{id} to delete the workflow.
    async deleteWorkflow(id: string): Promise<N8nWorkflow> {
      return this.makeRequest<N8nWorkflow>(`/workflows/${id}`, {
        method: 'DELETE',
      });
    }
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively communicates critical behavioral traits: the destructive nature ('cannot be undone') and a specific technical requirement (compact JSON formatting). This goes beyond what the input schema provides, though it doesn't cover aspects like error conditions or response format.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise and front-loaded: the first sentence states the core purpose, the second adds critical behavioral warning, and the third provides essential technical guidance. Every sentence earns its place with zero wasted words, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive tool with no annotations and no output schema, the description does well on behavioral transparency but leaves gaps. It doesn't explain what happens after deletion (e.g., confirmation message, error responses), doesn't clarify parameter roles, and doesn't mention dependencies or permissions. It's minimally adequate but incomplete given the tool's complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description mentions 'ID' but doesn't specify which parameter corresponds to the workflow ID versus clientId. With 0% schema description coverage and two required parameters, the description fails to add meaningful semantic context beyond implying one parameter is an ID. It doesn't explain what 'clientId' represents or how parameters relate to the deletion operation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Delete') and resource ('a workflow by ID'), distinguishing it from sibling tools like 'deactivate-workflow' or 'delete-project'. It uses precise language that leaves no ambiguity about what the tool does.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use this tool (to delete a workflow by ID) and implicitly distinguishes it from alternatives like 'deactivate-workflow' by emphasizing permanence ('cannot be undone'). However, it lacks explicit guidance on when NOT to use it or detailed prerequisites beyond the ID requirement.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

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