Skip to main content
Glama
spences10

mcp-n8n-builder

list_executions

Monitor and filter workflow execution history by status, duration, and timestamps with this tool. Identify errors, verify success, and analyze performance data using workflow ID or custom filters. Retrieve concise or detailed execution results as needed.

Instructions

Lists workflow execution history with details on success/failure status, duration, and timestamps. Use this tool to monitor workflow performance, troubleshoot issues, or verify that workflows are running as expected. Results can be filtered by workflow ID, status, and limited to a specific number.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of executions to return - useful for workflows with many executions
statusNoFilter by execution status (error, success, waiting)
verbosityNoOutput verbosity level (concise or full). Default is concise which preserves context window space. Use full when you need complete execution details.
workflowIdNoFilter executions by workflow ID - can be obtained from list_workflows

Implementation Reference

  • The primary handler function for the list_executions MCP tool. Fetches executions from N8n API, computes stats, formats detailed list with status, workflow, times, durations, and handles verbosity and errors.
    export async function handle_list_executions(
    	api_client: N8nApiClient,
    	args: any,
    ) {
    	try {
    		const executions = await api_client.list_executions(args);
    
    		if (!executions || executions.length === 0) {
    			return {
    				content: [
    					{
    						type: 'text',
    						text: 'No executions found.',
    					},
    				],
    			};
    		}
    
    		// Create a summary of the executions
    		const success_count = executions.filter(
    			(exec: any) => exec.finished && exec.status === 'success',
    		).length;
    		const failed_count = executions.filter(
    			(exec: any) => exec.finished && exec.status !== 'success',
    		).length;
    		const running_count = executions.filter(
    			(exec: any) => !exec.finished,
    		).length;
    
    		const summary =
    			`Found ${executions.length} execution${
    				executions.length !== 1 ? 's' : ''
    			} ` +
    			`(${success_count} successful, ${failed_count} failed, ${running_count} running):\n\n`;
    
    		// Create a list of executions with their basic info
    		const execution_list = executions
    			.map((exec: any, index: number) => {
    				const status = !exec.finished
    					? 'Running'
    					: exec.status === 'success'
    					? 'Successful'
    					: 'Failed';
    
    				const start_time = new Date(exec.startedAt).toLocaleString();
    				const end_time = exec.stoppedAt
    					? new Date(exec.stoppedAt).toLocaleString()
    					: 'Still running';
    
    				const duration = exec.stoppedAt
    					? (new Date(exec.stoppedAt).getTime() -
    							new Date(exec.startedAt).getTime()) /
    					  1000
    					: null;
    
    				const duration_text =
    					duration !== null
    						? `${duration.toFixed(2)} seconds`
    						: 'Still running';
    
    				return `${index + 1}. Execution ID: ${exec.id}
       Status: ${status}
       Workflow: ${exec.workflow_data?.name || 'Unknown'} (ID: ${
    					exec.workflowId
    				})
       Started: ${start_time}
       Duration: ${duration_text}`;
    			})
    			.join('\n\n');
    
    		return {
    			content: [
    				{
    					type: 'text',
    					text: format_output(
    						summary + execution_list,
    						executions,
    						args.verbosity,
    					),
    				},
    			],
    		};
    	} catch (error: any) {
    		return {
    			content: [
    				{
    					type: 'text',
    					text: `Error listing executions: ${
    						error.message || String(error)
    					}`,
    				},
    			],
    			isError: true,
    		};
    	}
    }
  • MCP tool schema registration for list_executions, defining name, description, and inputSchema with parameters: workflowId, status, limit, verbosity.
    	name: 'list_executions',
    	description:
    		'Lists workflow execution history with details on success/failure status, duration, and timestamps. Use this tool to monitor workflow performance, troubleshoot issues, or verify that workflows are running as expected. Results can be filtered by workflow ID, status, and limited to a specific number.',
    	inputSchema: {
    		type: 'object',
    		properties: {
    			workflowId: {
    				type: 'string',
    				description:
    					'Filter executions by workflow ID - can be obtained from list_workflows',
    			},
    			status: {
    				type: 'string',
    				description:
    					'Filter by execution status (error, success, waiting)',
    				enum: ['error', 'success', 'waiting'],
    			},
    			limit: {
    				type: 'number',
    				description:
    					'Maximum number of executions to return - useful for workflows with many executions',
    			},
    			verbosity: {
    				type: 'string',
    				description:
    					'Output verbosity level (concise or full). Default is concise which preserves context window space. Use full when you need complete execution details.',
    				enum: ['concise', 'full'],
    			},
    		},
    	},
    },
  • Registration of the list_executions handler in the switch statement for CallToolRequestSchema dispatching.
    case 'list_executions':
    	return await handle_list_executions(api_client, args);
  • Helper function used by list_executions handler to format output based on verbosity (concise or full).
    function format_output(
    	summary: string,
    	details: any,
    	verbosity?: string,
    ): string {
    	// Use the provided verbosity parameter if available, otherwise fall back to config
    	const output_verbosity = verbosity || config.output_verbosity;
    
    	if (output_verbosity === 'full') {
    		return (
    			summary +
    			'\n\nFull details:\n' +
    			JSON.stringify(details, null, 2)
    		);
    	} else {
    		// Default to concise mode
    		return summary;
    	}
    }
  • N8nApiClient method called by the handler to fetch executions from the n8n REST API, supporting filters for workflowId, status, and limit.
    async list_executions(
    	options?: ListExecutionsOptions,
    ): Promise<any> {
    	let endpoint = '/executions';
    
    	if (options) {
    		const params = new URLSearchParams();
    
    		if (options.workflowId) {
    			params.append('workflowId', options.workflowId);
    		}
    
    		if (options.status) {
    			params.append('status', options.status);
    		}
    
    		if (options.limit) {
    			params.append('limit', String(options.limit));
    		}
    
    		const query_string = params.toString();
    		if (query_string) {
    			endpoint += `?${query_string}`;
    		}
    	}
    
    	const response = await this.request<any>('GET', endpoint);
    	return response.data || response;
    }
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses that the tool lists 'history with details' and mentions filtering capabilities, but lacks information on permissions, rate limits, pagination, or response format. For a read-only tool with no annotations, this is adequate but leaves behavioral gaps.

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 appropriately sized and front-loaded, with the core purpose stated first. Every sentence adds value: the first defines the tool, the second gives usage guidelines, and the third explains filtering options. There is no wasted text.

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?

Given the tool's complexity (4 parameters, no output schema, no annotations), the description is complete enough for basic use but lacks details on output structure, error handling, or advanced behavioral traits. It covers purpose and filtering but doesn't fully compensate for the absence of annotations and output schema.

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 fully documents all 4 parameters. The description adds marginal value by mentioning filtering by 'workflow ID, status, and limited to a specific number,' which aligns with the schema but doesn't provide additional syntax or format details beyond what's already in the schema descriptions.

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 tool's purpose with specific verbs ('Lists workflow execution history') and resources ('workflow execution'), distinguishing it from siblings like 'get_execution' (singular) or 'list_workflows' (different resource). It specifies the details included: 'success/failure status, duration, and timestamps'.

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 monitor workflow performance, troubleshoot issues, or verify that workflows are running as expected.' It does not explicitly state when not to use it or name alternatives, but it implies usage for historical data rather than single executions (vs. 'get_execution').

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