Skip to main content
Glama

get-workflow

Retrieve detailed information about a specific workflow using its ID after listing workflows. Requires client ID and workflow ID as compact JSON input.

Instructions

Retrieve a workflow by ID. Use after list-workflows to get detailed information about a specific workflow. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
clientIdYes
idYes

Implementation Reference

  • MCP tool handler for 'get-workflow': validates clientId, retrieves N8nClient instance, calls client.getWorkflow(id), and returns the workflow JSON or error.
    case "get-workflow": {
      const { clientId, id } = args as { clientId: string; id: string };
      const client = clients.get(clientId);
      if (!client) {
        return {
          content: [{
            type: "text",
            text: "Client not initialized. Please run init-n8n first.",
          }],
          isError: true
        };
      }
    
      try {
        const workflow = await client.getWorkflow(id);
        return {
          content: [{
            type: "text",
            text: JSON.stringify(workflow, null, 2),
          }]
        };
      } catch (error) {
        return {
          content: [{
            type: "text",
            text: error instanceof Error ? error.message : "Unknown error occurred",
          }],
          isError: true
        };
      }
    }
  • src/index.ts:424-434 (registration)
    Tool registration in ListTools response, defining name, description, and input schema for 'get-workflow'.
      name: "get-workflow",
      description: "Retrieve a workflow by ID. Use after list-workflows to get detailed information about a specific workflow. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.",
      inputSchema: {
        type: "object",
        properties: {
          clientId: { type: "string" },
          id: { type: "string" }
        },
        required: ["clientId", "id"]
      }
    },
  • N8nClient helper method that performs the actual API call to fetch workflow by ID via makeRequest.
    async getWorkflow(id: string): Promise<N8nWorkflow> {
      return this.makeRequest<N8nWorkflow>(`/workflows/${id}`);
    }
  • TypeScript interface defining the structure of an N8n workflow object returned by the API.
    interface N8nWorkflow {
      id: number;
      name: string;
      active: boolean;
      createdAt: string;
      updatedAt: string;
      tags: string[];
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the IMPORTANT formatting requirement for arguments, which is valuable behavioral context. However, it doesn't describe what 'detailed information' includes, whether authentication is needed, rate limits, error conditions, or response format. For a read operation with zero annotation coverage, this leaves significant 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 extremely concise with only two sentences, both of which earn their place. The first sentence states the core purpose, the second provides usage guidance and a critical formatting requirement. No wasted words or redundant information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, 0% schema description coverage, and no output schema, the description is incomplete. While it provides good purpose and usage guidance, it lacks information about what 'detailed information' the tool returns, authentication requirements, error handling, and the semantics of the two required parameters. For a tool that presumably returns structured workflow data, this leaves too many gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the schema provides no parameter documentation. The description mentions 'workflow by ID' which implies the 'id' parameter, but doesn't explain what 'clientId' represents or how these parameters relate. It adds minimal semantic value beyond what's obvious from the parameter names themselves.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'retrieve' and resource 'workflow by ID', making the purpose unambiguous. It distinguishes from sibling tools like 'list-workflows' by focusing on a single workflow rather than listing multiple. However, it doesn't explicitly differentiate from other get-* tools like 'get-execution' or 'get-user' beyond the resource name.

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?

The description provides explicit usage guidance: 'Use after list-workflows to get detailed information about a specific workflow.' This clearly indicates when to use this tool versus the sibling 'list-workflows' tool, establishing a logical sequence of operations.

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/fellipesaraiva88/n8n-mcp-server'

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