Skip to main content
Glama

list_variables

Retrieve and manage workflow variables from n8n with pagination support for efficient data handling.

Instructions

List all variables with pagination support

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
cursorNo

Implementation Reference

  • MCP tool handler that executes list_variables by delegating to N8nClient.listVariables and formatting the 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)
    Tool registration in the listTools response, including name, description, and input schema.
    { name: 'list_variables', description: 'List all variables with pagination support', inputSchema: { type: 'object', properties: { limit: { type: 'number' }, cursor: { type: 'string' } } } },
  • Input schema definition for the list_variables tool parameters (limit and cursor).
    { name: 'list_variables', description: 'List all variables with pagination support', inputSchema: { type: 'object', properties: { limit: { type: 'number' }, cursor: { type: 'string' } } } },
  • N8nClient helper method that makes the actual API GET request to /variables endpoint with pagination params.
    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; }

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