Skip to main content
Glama

list-workflows

Retrieve all available workflows from n8n to view and manage automation processes. Use this tool to see existing workflows after initializing the n8n connection.

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 function for executing the 'list-workflows' tool. It validates the client ID, fetches workflows using N8nClient.listWorkflows(), formats the data, and returns it as JSON or handles errors.
    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 in the ListToolsRequestSchema handler's tools array, including name, description, and input schema.
      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 definition for the 'list-workflows' tool, specifying the required 'clientId' parameter.
    inputSchema: {
      type: "object",
      properties: {
        clientId: { type: "string" }
      },
      required: ["clientId"]
    }
  • Helper method in N8nClient class that performs the API request to list workflows from the n8n server.
    async listWorkflows(): Promise<N8nWorkflowList> {
      return this.makeRequest<N8nWorkflowList>('/workflows');
    }
  • TypeScript interface defining the structure of the workflows list response from n8n API.
    interface N8nWorkflowList {
      data: N8nWorkflow[];
      nextCursor?: string;
    }
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 mentions that arguments must be provided as compact JSON, which is a useful behavioral constraint not covered elsewhere. However, it lacks details on permissions, rate limits, pagination, or what the output looks like, leaving gaps for a tool with no annotation coverage.

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 concise and front-loaded, with two sentences that efficiently convey purpose, usage, and a critical formatting requirement. Every sentence adds value without unnecessary elaboration, making it easy to parse.

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 the tool has no annotations, no output schema, and low parameter coverage, the description is incomplete. It covers usage timing and argument format but misses essential details like return values, error handling, or behavioral traits, which are crucial for effective tool invocation in this context.

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?

The input schema has 1 parameter with 0% description coverage, and the description does not explain what 'clientId' means or how it should be used. It only specifies the format for arguments (compact JSON), which adds minimal semantic value beyond the schema's structural information.

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. However, it does not explicitly differentiate from sibling tools like 'get-workflow' or 'list-executions', which would require mentioning it retrieves multiple workflows without filtering details.

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 by stating 'Use after init-n8n to see available workflows,' indicating a prerequisite and timing. It also implies an alternative context for viewing workflows, though it does not name specific sibling alternatives, the guidance is clear and actionable.

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

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