Skip to main content
Glama

list_variables

Retrieve all workflow variables with pagination support to manage and access configuration data across n8n automation workflows.

Instructions

List all variables with pagination support

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cursorNo
limitNo

Implementation Reference

  • The main handler function for the 'list_variables' MCP tool. It calls the N8nClient's listVariables method with pagination parameters and returns a formatted JSON response.
    private async handleListVariables(args?: { limit?: number; cursor?: string }) { const response = await this.n8nClient.listVariables(args?.limit, args?.cursor); return { content: [{ type: 'text', text: JSON.stringify(jsonSuccess(response), null, 2) }] }; }
  • src/index.ts:184-184 (registration)
    Registration of the 'list_variables' tool in the MCP server's ListTools response, including the tool name, description, and input schema definition.
    { name: 'list_variables', description: 'List all variables with pagination support', inputSchema: { type: 'object', properties: { limit: { type: 'number' }, cursor: { type: 'string' } } } },
  • Underlying N8nClient helper method that makes the HTTP GET request to the n8n /variables API endpoint with optional pagination parameters.
    async listVariables(limit?: number, cursor?: string): Promise<N8nVariablesListResponse> { const params = new URLSearchParams(); if (limit) params.append('limit', limit.toString()); if (cursor) params.append('cursor', cursor); const url = params.toString() ? `/variables?${params.toString()}` : '/variables'; const response = await this.api.get<N8nVariablesListResponse>(url); return response.data; }
  • Dispatch logic in the main CallToolRequestHandler switch statement that routes 'list_variables' calls to the dedicated handler function.
    case 'list_variables': return await this.handleListVariables(request.params.arguments as { limit?: number; cursor?: string });

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

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