Skip to main content
Glama
spences10

mcp-n8n-builder

get_execution

Retrieve detailed workflow execution data including status, timestamps, and node-level input/output for debugging or analyzing data transformations in n8n workflows.

Instructions

Retrieves detailed information about a specific workflow execution, including execution time, status, and optionally the full data processed at each step. Particularly useful for debugging failed workflows or understanding data transformations between nodes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesID of the execution to retrieve - can be obtained from list_executions
includeDataNoWhether to include detailed execution data showing the input/output at each node (may be large for complex workflows)
verbosityNoOutput verbosity level (concise or full). Default is concise which preserves context window space. Use full when you need complete execution details.

Implementation Reference

  • The handler function that implements the get_execution tool logic: validates input, calls N8nApiClient to fetch execution data, formats a human-readable summary with status, timings, and duration, and returns formatted text output or error.
    export async function handle_get_execution(
    	api_client: N8nApiClient,
    	args: any,
    ) {
    	if (!args.id) {
    		throw new McpError(
    			ErrorCode.InvalidParams,
    			'Execution ID is required',
    		);
    	}
    
    	try {
    		const execution = await api_client.get_execution(
    			args.id,
    			args.includeData,
    		);
    
    		// Format a summary of the execution
    		const status = execution.finished
    			? execution.status === 'success'
    				? 'Successful'
    				: 'Failed'
    			: 'Running';
    
    		const start_time = new Date(execution.startedAt).toLocaleString();
    		const end_time = execution.stoppedAt
    			? new Date(execution.stoppedAt).toLocaleString()
    			: 'Still running';
    
    		const duration = execution.stoppedAt
    			? (new Date(execution.stoppedAt).getTime() -
    					new Date(execution.startedAt).getTime()) /
    			  1000
    			: null;
    
    		const duration_text =
    			duration !== null
    				? `${duration.toFixed(2)} seconds`
    				: 'Still running';
    
    		const summary = `Execution ID: ${args.id}
    Status: ${status}
    Workflow: ${execution.workflow_data?.name || 'Unknown'} (ID: ${
    			execution.workflowId
    		})
    Mode: ${execution.mode}
    Started: ${start_time}
    Ended: ${end_time}
    Duration: ${duration_text}`;
    
    		return {
    			content: [
    				{
    					type: 'text',
    					text: format_output(summary, execution, args.verbosity),
    				},
    			],
    		};
    	} catch (error: any) {
    		return {
    			content: [
    				{
    					type: 'text',
    					text: `Error retrieving execution: ${
    						error.message || String(error)
    					}`,
    				},
    			],
    			isError: true,
    		};
    	}
    }
  • Tool schema definition including name, description, and input schema for get_execution in the MCP tools list response.
    	name: 'get_execution',
    	description:
    		'Retrieves detailed information about a specific workflow execution, including execution time, status, and optionally the full data processed at each step. Particularly useful for debugging failed workflows or understanding data transformations between nodes.',
    	inputSchema: {
    		type: 'object',
    		properties: {
    			id: {
    				type: 'string',
    				description:
    					'ID of the execution to retrieve - can be obtained from list_executions',
    			},
    			includeData: {
    				type: 'boolean',
    				description:
    					'Whether to include detailed execution data showing the input/output at each node (may be large for complex workflows)',
    			},
    			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'],
    			},
    		},
    		required: ['id'],
    	},
    },
  • Tool dispatch registration in the switch statement that routes calls to the handle_get_execution function.
    case 'get_execution':
    	return await handle_get_execution(api_client, args);
  • Helper function used by the handler to format output based on verbosity level (concise summary or full JSON details).
    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 that performs the actual API request to retrieve execution data, called by the tool handler.
    async get_execution(
    	id: string,
    	include_data?: boolean,
    ): Promise<any> {
    	let endpoint = `/executions/${id}`;
    
    	if (include_data !== undefined) {
    		endpoint += `?includeData=${include_data}`;
    	}
    
    	return this.request<any>('GET', endpoint);
    }
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 retrieves information (implying read-only) and mentions potential data size issues ('may be large for complex workflows'), adding some behavioral context. However, it lacks details on permissions, rate limits, or error handling, leaving gaps for a mutation-heavy context.

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 front-loaded with the core purpose, followed by specific use cases. Both sentences earn their place by adding clarity and context without redundancy, making it efficient and well-structured.

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 no annotations and no output schema, the description provides adequate purpose and usage guidance but lacks details on return values, error cases, or system constraints. For a tool with 3 parameters and in a workflow execution context, it is minimally viable but has clear gaps in behavioral transparency.

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 all parameters thoroughly. The description adds minimal value beyond the schema by implying the 'includeData' parameter's impact on debugging, but it does not provide additional syntax or format details. Baseline 3 is appropriate when the schema does the heavy lifting.

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 verb ('retrieves') and resource ('detailed information about a specific workflow execution'), specifying what it does. It distinguishes from siblings like 'list_executions' by focusing on a single execution and mentioning debugging use cases, making it specific and differentiated.

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 on when to use it ('Particularly useful for debugging failed workflows or understanding data transformations between nodes'), which helps differentiate from tools like 'list_executions'. However, it does not explicitly state when not to use it or name specific alternatives, keeping it at a 4.

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