Skip to main content
Glama
spences10

mcp-n8n-builder

deactivate_workflow

Deactivate a specific workflow by ID to stop automatic execution while retaining it for manual use or future reactivation. Ideal for temporarily pausing workflows without deletion.

Instructions

Deactivates a workflow by its ID, preventing it from running automatically. The workflow will still exist and can be manually executed or reactivated later. Use this instead of deleting workflows that you might need again.

Input Schema

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

Implementation Reference

  • The primary handler function that implements the deactivate_workflow tool logic. It validates the workflow ID, calls the N8nApiClient to perform the deactivation, and returns a formatted success or error message.
     * Handles the deactivate_workflow tool
     */
    export async function handle_deactivate_workflow(
    	api_client: N8nApiClient,
    	args: any,
    ) {
    	if (!args.id) {
    		throw new McpError(
    			ErrorCode.InvalidParams,
    			'Workflow ID is required',
    		);
    	}
    
    	try {
    		const result = await api_client.deactivate_workflow(args.id);
    		return {
    			content: [
    				{
    					type: 'text',
    					text: `Successfully deactivated workflow "${result.name}" (ID: ${args.id})`,
    				},
    			],
    		};
    	} catch (error: any) {
    		return {
    			content: [
    				{
    					type: 'text',
    					text: `Error deactivating workflow: ${
    						error.message || String(error)
    					}`,
    				},
    			],
    			isError: true,
    		};
    	}
    }
  • Defines the tool's input schema, specifying that it requires a 'id' string parameter for the workflow ID.
    {
    	name: 'deactivate_workflow',
    	description:
    		'Deactivates a workflow by its ID, preventing it from running automatically. The workflow will still exist and can be manually executed or reactivated later. Use this instead of deleting workflows that you might need again.',
    	inputSchema: {
    		type: 'object',
    		properties: {
    			id: {
    				type: 'string',
    				description:
    					'ID of the workflow to deactivate - can be obtained from list_workflows',
    			},
    		},
    		required: ['id'],
    	},
    },
  • Wires the deactivate_workflow tool name to the handle_deactivate_workflow function in the central tool dispatching switch statement.
    case 'deactivate_workflow':
    	return await handle_deactivate_workflow(api_client, args);
  • Helper method in the N8nApiClient class that performs the actual HTTP POST request to the n8n API endpoint to deactivate the specified workflow.
    /**
     * Deactivate a workflow
     */
    async deactivate_workflow(id: string): Promise<any> {
    	return this.request<any>('POST', `/workflows/${id}/deactivate`);
    }
Behavior4/5

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

With no annotations provided, the description carries full burden and does well: it discloses the tool's effect (workflow stops running automatically but remains accessible), reversibility (can be reactivated later), and persistence (still exists for manual execution). It doesn't mention permissions or error conditions, but covers key behavioral aspects.

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?

Two sentences, front-loaded with the core purpose, followed by important behavioral context and usage guidance. Every sentence adds value with zero waste, making it highly efficient.

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 mutation tool with no annotations and no output schema, the description provides good context: it explains the action, outcome, and when to use it. It could mention error cases or return values, but covers the essentials well given the complexity.

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?

Schema description coverage is 100%, so the schema already documents the 'id' parameter fully. The description adds no additional parameter details beyond what's in the schema, meeting the baseline for high 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 ('deactivates'), target resource ('workflow'), and mechanism ('by its ID'), distinguishing it from siblings like delete_workflow. It explains the effect ('preventing it from running automatically') and contrasts with deletion.

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?

It explicitly states when to use this tool ('instead of deleting workflows that you might need again') and implies when not to use it (if permanent removal is needed, use delete_workflow). This provides clear guidance relative to alternatives.

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