Skip to main content
Glama

update_variable

Modify existing variable values in n8n workflows to adapt workflow behavior and maintain data consistency across automated processes.

Instructions

Update an existing variable value

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes
valueYes

Implementation Reference

  • MCP tool handler for 'update_variable'. Parses arguments, calls N8nClient.updateVariable, formats JSON success response.
    private async handleUpdateVariable(args: { id: string; value: string }) { const variable = await this.n8nClient.updateVariable(args.id, { value: args.value }); return { content: [{ type: 'text', text: JSON.stringify(jsonSuccess(variable), null, 2) }] };
  • src/index.ts:186-186 (registration)
    Registers the 'update_variable' tool in the MCP server's listTools response, including name, description, and input schema.
    { name: 'update_variable', description: 'Update an existing variable value', inputSchema: { type: 'object', properties: { id: { type: 'string' }, value: { type: 'string' } }, required: ['id', 'value'] } },
  • Input schema definition for 'update_variable' tool: requires 'id' (string) and 'value' (string).
    { name: 'update_variable', description: 'Update an existing variable value', inputSchema: { type: 'object', properties: { id: { type: 'string' }, value: { type: 'string' } }, required: ['id', 'value'] } },
  • N8nClient helper method that performs the HTTP PUT request to update a variable via n8n API.
    async updateVariable(id: string, variable: Partial<N8nVariable>): Promise<N8nVariable> { const response = await this.api.put<N8nApiResponse<N8nVariable>>(`/variables/${id}`, variable); return response.data.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