Skip to main content
Glama
spences10

mcp-n8n-builder

delete_workflow

Permanently remove a workflow by its ID from the MCP n8n-builder server. Use this irreversible action carefully; consider deactivating workflows if reuse is possible.

Instructions

Permanently deletes a workflow by its ID. This action cannot be undone, so use with caution. Consider deactivating workflows instead if you might need them again later.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesID of the workflow to delete - can be obtained from list_workflows

Implementation Reference

  • The handler function that executes the delete_workflow tool. It validates the workflow ID, retrieves the workflow details to include the name in the response, calls the API client to delete the workflow, and returns a success or error message.
    /**
     * Handles the delete_workflow tool
     */
    export async function handle_delete_workflow(
    	api_client: N8nApiClient,
    	args: any,
    ) {
    	if (!args.id) {
    		throw new McpError(
    			ErrorCode.InvalidParams,
    			'Workflow ID is required',
    		);
    	}
    
    	// First get the workflow to show its name
    	try {
    		const workflow = await api_client.get_workflow(args.id);
    
    		// Now delete the workflow
    		const result = await api_client.delete_workflow(args.id);
    
    		return {
    			content: [
    				{
    					type: 'text',
    					text: `Successfully deleted workflow "${workflow.name}" (ID: ${args.id})`,
    				},
    			],
    		};
    	} catch (error: any) {
    		return {
    			content: [
    				{
    					type: 'text',
    					text: `Error deleting workflow: ${
    						error.message || String(error)
    					}`,
    				},
    			],
    			isError: true,
    		};
    	}
    }
  • Registration of the 'delete_workflow' tool in the MCP server, including name, description, and input schema definition.
    	name: 'delete_workflow',
    	description:
    		'Permanently deletes a workflow by its ID. This action cannot be undone, so use with caution. Consider deactivating workflows instead if you might need them again later.',
    	inputSchema: {
    		type: 'object',
    		properties: {
    			id: {
    				type: 'string',
    				description:
    					'ID of the workflow to delete - can be obtained from list_workflows',
    			},
    		},
    		required: ['id'],
    	},
    },
  • The switch case in the tool call handler that routes calls to 'delete_workflow' to the handle_delete_workflow function.
    case 'delete_workflow':
    	return await handle_delete_workflow(api_client, args);
  • The N8nApiClient helper method that performs the actual HTTP DELETE request to delete the workflow from the n8n API.
    async delete_workflow(id: string): Promise<any> {
    	return this.request<any>('DELETE', `/workflows/${id}`);
    }
  • Import of the handle_delete_workflow function from workflow-tools.js for use in tool registration.
    handle_delete_workflow,
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 action is permanent and irreversible ('cannot be undone'), and it suggests caution. However, it doesn't mention potential side effects like cascading deletions or permission requirements.

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 perfectly front-loaded with the core purpose in the first sentence, followed by crucial warnings and alternatives. Every sentence earns its place with no wasted words, making it highly efficient and scannable.

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

Completeness4/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 an excellent job covering the most critical aspects: purpose, irreversible nature, and alternatives. It could be more complete by mentioning what happens to associated executions or data, but given the context, it's substantially helpful.

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

Parameters3/5

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

The schema description coverage is 100%, with the single parameter 'id' well-documented in the schema. The description doesn't add any parameter-specific information beyond what's already in the schema, so it meets the baseline expectation for high schema coverage.

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 ('permanently deletes') and resource ('a workflow by its ID'), distinguishing it from siblings like deactivate_workflow and update_workflow. It uses precise language that leaves no ambiguity about the tool's function.

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

Usage Guidelines5/5

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

The description provides explicit guidance on when to use this tool ('permanently deletes') versus alternatives ('consider deactivating workflows instead if you might need them again later'). It clearly warns about irreversible consequences and suggests a safer alternative when appropriate.

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/spences10/mcp-n8n-builder'

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