Skip to main content
Glama
AutomateLab-tech

automatelab-n8n-mcp

n8n_get_workflow

Retrieve a complete n8n workflow JSON by ID for auditing or integration with n8n_lint_workflow.

Instructions

Fetch a single workflow JSON by id from a live n8n instance (requires N8N_API_URL + N8N_API_KEY). Returns the full nodes/connections payload — pair with n8n_lint_workflow to audit a deployed workflow.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesWorkflow ID.

Implementation Reference

  • src/index.ts:70-75 (registration)
    Tool 'n8n_get_workflow' is registered in the tools array with its name, description, and inputSchema (getWorkflowInputSchema imported from rest-api.ts).
    {
    	name: "n8n_get_workflow",
    	description:
    		"Fetch a single workflow JSON by id from a live n8n instance (requires N8N_API_URL + N8N_API_KEY). Returns the full nodes/connections payload — pair with n8n_lint_workflow to audit a deployed workflow.",
    	inputSchema: getWorkflowInputSchema,
    },
  • src/index.ts:121-122 (registration)
    The request handler dispatches 'n8n_get_workflow' calls to the getWorkflow function.
    case "n8n_get_workflow":
    	return getWorkflow(args ?? {});
  • getWorkflowInputSchema defines the input: a required 'id' string field.
    export const getWorkflowInputSchema = {
    	type: "object",
    	properties: {
    		id: { type: "string", description: "Workflow ID." },
    	},
    	required: ["id"],
    } as const;
  • getWorkflowZod is a Zod schema validating the 'id' parameter for getWorkflow.
    const getWorkflowZod = z.object({ id: z.string().min(1) });
  • getWorkflow is the handler function: it reads config, parses args with Zod, calls GET /workflows/:id via the n8n REST API, and returns the full workflow JSON.
    export async function getWorkflow(rawArgs: unknown) {
    	const cfg = getConfig();
    	if ("error" in cfg) return textResult(cfg.error);
    	const args = getWorkflowZod.parse(rawArgs);
    	const r = await call(cfg, "GET", `/workflows/${encodeURIComponent(args.id)}`);
    	if (!r.ok) return textResult(r.error);
    	return jsonResult(r.data);
    }
Behavior3/5

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

With no annotations, the description carries the burden. It states the action (fetch) and output (full nodes/connections payload). It does not disclose error handling, rate limits, or authentication details beyond the simple requirement, which is acceptable for a simple GET-like tool.

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 two concise sentences. The first sentence states purpose and requirements, the second describes output and usage suggestion. No redundancy, 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?

Given the tool's simplicity (1 parameter, no nested objects, no output schema), the description covers purpose, prerequisites, output, and a usage hint. It could mention error scenarios, but the information provided is sufficient for an agent to use the tool safely.

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 only parameter 'id' is fully described in the schema (100% coverage). The description adds no additional information about the parameter, so it meets the baseline of 3.

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 fetches a single workflow JSON by ID, specifies the resource (full nodes/connections payload), and distinguishes it from siblings like n8n_list_workflows. The pairing suggestion with n8n_lint_workflow further clarifies its role.

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 prerequisites (N8N_API_URL, N8N_API_KEY) and suggests pairing with n8n_lint_workflow for auditing. However, it does not explicitly define when not to use this tool or list alternatives beyond the sibling context.

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

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/AutomateLab-tech/n8n-mcp'

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