Skip to main content
Glama
DrBalls

n8n MCP Server

by DrBalls

n8n_get_variable

Retrieve a specific variable by its unique ID to access stored data values for workflow automation in n8n.

Instructions

Get a specific variable by ID.

Args:

  • id (string): Variable ID

Returns: Variable details with id, key, and value.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe unique identifier of the resource

Implementation Reference

  • The handler function for 'n8n_get_variable' that fetches a variable by ID from the n8n API.
      async (params: z.infer<typeof IdParamSchema>) => {
        const variable = await get<N8nVariable>(`/variables/${params.id}`);
        
        return {
          content: [{ type: 'text', text: formatVariable(variable) }],
          structuredContent: variable
        };
      }
    );
  • Registration of the 'n8n_get_variable' tool using the IdParamSchema input schema.
      server.registerTool(
        'n8n_get_variable',
        {
          title: 'Get n8n Variable',
          description: `Get a specific variable by ID.
    
    Args:
      - id (string): Variable ID
    
    Returns:
      Variable details with id, key, and value.`,
          inputSchema: IdParamSchema,
          annotations: {
            readOnlyHint: true,
            destructiveHint: false,
            idempotentHint: true,
            openWorldHint: false
          }
        },

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

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