Skip to main content
Glama

list-workflows

Retrieve and display all available workflows in n8n after initialization. Input required: compact JSON with clientId for streamlined access.

Instructions

List all workflows from n8n. Use after init-n8n to see available workflows. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
clientIdYes

Implementation Reference

  • The primary handler for executing the 'list-workflows' tool. It retrieves the N8nClient instance using the provided clientId, calls the client's listWorkflows method, formats the workflow data, and returns it as a JSON string in the tool response.
    case "list-workflows": {
      const { clientId } = args as { clientId: 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 workflows = await client.listWorkflows();
        const formattedWorkflows = workflows.data.map(wf => ({
          id: wf.id,
          name: wf.name,
          active: wf.active,
          created: wf.createdAt,
          updated: wf.updatedAt,
          tags: wf.tags,
        }));
    
        return {
          content: [{
            type: "text",
            text: JSON.stringify(formattedWorkflows, null, 2),
          }]
        };
      } catch (error) {
        return {
          content: [{
            type: "text",
            text: error instanceof Error ? error.message : "Unknown error occurred",
          }],
          isError: true
        };
      }
    }
  • src/index.ts:413-422 (registration)
    Registration of the 'list-workflows' tool within the ListToolsRequestSchema handler. Defines the tool's name, description, and input schema, making it discoverable by MCP clients.
      name: "list-workflows",
      description: "List all workflows from n8n. Use after init-n8n to see available workflows. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.",
      inputSchema: {
        type: "object",
        properties: {
          clientId: { type: "string" }
        },
        required: ["clientId"]
      }
    },
  • Input schema for the 'list-workflows' tool, specifying that a 'clientId' string is required.
    inputSchema: {
      type: "object",
      properties: {
        clientId: { type: "string" }
      },
      required: ["clientId"]
    }
  • Core helper method in the N8nClient class that makes the HTTP request to the n8n API endpoint '/workflows' to retrieve the list of workflows.
    async listWorkflows(): Promise<N8nWorkflowList> {
      return this.makeRequest<N8nWorkflowList>('/workflows');
    }
  • TypeScript interface defining the structure of the response from the n8n workflows list API, used by the listWorkflows method.
    interface N8nWorkflowList {
      data: N8nWorkflow[];
      nextCursor?: string;
    }
Behavior2/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 mentions the requirement for 'compact, single-line JSON' arguments, which is useful behavioral context. However, it lacks details on permissions, rate limits, pagination, or what the output looks like (e.g., list format, fields included). For a read operation with no annotation coverage, this is insufficient.

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 sentences, front-loaded with the core purpose, followed by important usage and formatting notes. Every sentence adds value: the first states what it does and when to use it, the second provides critical input formatting guidance. No wasted words.

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, 0% schema coverage, and no output schema, the description is moderately complete. It covers purpose, prerequisites, and input formatting but misses parameter details, output behavior, and operational constraints. For a simple list tool, it's adequate but has clear 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 description must compensate. It mentions 'Arguments must be provided as compact, single-line JSON' but doesn't explain the 'clientId' parameter's purpose, format, or where to obtain it. With one undocumented parameter, the description adds minimal value beyond the schema.

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 'List' and resource 'all workflows from n8n', making the purpose specific and understandable. It distinguishes from siblings like 'get-workflow' (singular) by indicating it retrieves multiple workflows. However, it doesn't explicitly differentiate from other list tools like 'list-executions' or 'list-projects' 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 Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context with 'Use after init-n8n to see available workflows', giving a prerequisite and timing guidance. It doesn't explicitly state when not to use it or name alternatives, but the sibling tools include 'get-workflow' for single workflows, which is implied by the plural vs. singular naming.

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