Skip to main content
Glama

list-variables

Retrieve all available variables from n8n workflows to access stored data and configuration values for automation processes.

Instructions

List all variables from n8n. NOTE: Requires n8n Enterprise license with variable management features enabled. Use after init-n8n to see available variables. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
clientIdYes

Implementation Reference

  • The execution handler for the 'list-variables' MCP tool. It retrieves the stored N8nClient instance using the provided clientId, calls listVariables() on it, and returns the formatted list of variables as JSON or an error message.
    case "list-variables": {
      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 variables = await client.listVariables();
        return {
          content: [{
            type: "text",
            text: JSON.stringify(variables.data, null, 2),
          }]
        };
      } catch (error) {
        return {
          content: [{
            type: "text",
            text: error instanceof Error ? error.message : "Unknown error occurred",
          }],
          isError: true
        };
      }
    }
  • Input schema for the 'list-variables' tool, defining the required 'clientId' parameter.
        type: "object",
        properties: {
          clientId: { type: "string" }
        },
        required: ["clientId"]
      }
    },
  • src/index.ts:616-626 (registration)
    Registration of the 'list-variables' tool in the listTools response. Includes name, description, and input schema.
      name: "list-variables",
      description: "List all variables from n8n. NOTE: Requires n8n Enterprise license with variable management features enabled. Use after init-n8n to see available variables. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.",
      inputSchema: {
        type: "object",
        properties: {
          clientId: { type: "string" }
        },
        required: ["clientId"]
      }
    },
    {
  • N8nClient helper method that performs the API request to '/variables' to list all variables.
    async listVariables(): Promise<N8nVariableList> {
      return this.makeRequest<N8nVariableList>('/variables');
    }
  • TypeScript interface definitions for N8nVariable and N8nVariableList used in the response typing for list-variables.
    interface N8nVariable {
      id: string;
      key: string;
      value: string;
      type?: string;
    }
    
    interface N8nVariableList {
      data: N8nVariable[];
      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 discloses licensing requirements and technical constraints for arguments, which are useful behavioral traits. However, it does not cover other aspects like rate limits, error handling, or output format, leaving gaps for a tool with no annotations. This is adequate but incomplete.

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 front-loaded with the core purpose, followed by prerequisites and technical details in a concise manner. Each sentence adds necessary information without redundancy, making it efficient and well-structured for quick understanding.

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, no output schema, and low schema coverage, the description provides good usage guidelines and some behavioral context but lacks details on parameters and output. It is partially complete, suitable for a simple list tool but could be improved with parameter explanations or output hints.

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 the 'clientId' parameter's meaning, purpose, or format. It only mentions argument formatting in general. Since schema coverage is low, the description fails to compensate for the undocumented parameter, adding 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 tool's purpose: 'List all variables from n8n.' It specifies the resource (variables) and the action (list), but does not explicitly differentiate it from sibling tools like 'get-variable' or 'create-variable' beyond the 'list' verb, which is implied by the name. This makes it clear but not fully distinct from siblings.

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 guidelines: it states prerequisites ('Requires n8n Enterprise license with variable management features enabled'), references a sibling tool for setup ('Use after init-n8n to see available variables'), and includes a technical requirement ('Arguments must be provided as compact, single-line JSON without whitespace or newlines'). This covers when to use and important constraints effectively.

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