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
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| cursor | No |
Implementation Reference
- src/index.ts:463-466 (handler)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' } } } },
- src/index.ts:184-184 (schema)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' } } } },
- src/n8n-client.ts:709-716 (helper)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; }