get_execution
Retrieves detailed information about a specific workflow execution using its ID.
Instructions
Get details of a specific execution
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| executionId | Yes | The ID of the execution |
Implementation Reference
- src/handlers.ts:121-123 (handler)Handler case for 'get_execution' tool: parses the executionId from args using ExecutionIdSchema, then calls client.getExecution(executionId).
case "get_execution": { const { executionId } = ExecutionIdSchema.parse(args); return await client.getExecution(executionId); - src/handlers.ts:47-49 (schema)Zod schema for get_execution input validation: expects a string 'executionId'.
const ExecutionIdSchema = z.object({ executionId: z.string(), }); - src/tools.ts:207-220 (registration)Tool registration metadata for 'get_execution': describes getting details of a specific execution, requires executionId string input.
{ name: "get_execution", description: "Get details of a specific execution", inputSchema: { type: "object", properties: { executionId: { type: "string", description: "The ID of the execution", }, }, required: ["executionId"], }, }, - src/n8n-client.ts:123-126 (helper)Client method getExecution(id): makes GET request to /api/v1/executions/{id} and validates the response with ExecutionSchema.
async getExecution(id: string) { const response = await this.client.get(`/api/v1/executions/${id}`); return ExecutionSchema.parse(response.data); } - src/index.ts:37-74 (registration)Main server entry point: routes incoming tool call requests to handleToolCall(name, args, n8nClient) which dispatches to the correct handler case.
server.setRequestHandler(CallToolRequestSchema, async (request) => { try { const { name, arguments: args } = request.params; const result = await handleToolCall(name, args, n8nClient); return { content: [ { type: "text", text: typeof result === "string" ? result : JSON.stringify(result, null, 2), }, ], }; } catch (error) { const errorMessage = error instanceof Error ? error.message : "Unknown error occurred"; return { content: [ { type: "text", text: `Error: ${errorMessage}`, }, ], }; } }); // Start server async function main() { const transport = new StdioServerTransport(); await server.connect(transport); console.error("n8n MCP server running on stdio"); console.error(`Connected to n8n at: ${process.env.N8N_URL || "http://localhost:5678"}`); } main().catch((error) => { console.error("Fatal error:", error); process.exit(1); });