n8n_update_variable
Update environment variables in n8n workflows by modifying their ID, key, value, or type to maintain workflow configurations.
Instructions
Update an environment variable
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"id": "<id>"
},
"name": "n8n_update_variable"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Variable ID | |
| key | No | New variable key | |
| value | No | New variable value | |
| type | No | Variable type |
Implementation Reference
- src/index.ts:235-242 (handler)Handler logic for 'n8n_update_variable' that calls n8nClient.updateVariable.
case 'n8n_update_variable': { if (!args?.id) throw new Error('id is required'); const { id, ...data } = args; const result = await n8nClient.updateVariable(id as string, data); return { content: [{ type: 'text', text: formatResponse(result) }], }; } - src/index.ts:682-694 (schema)Input schema definition for the 'n8n_update_variable' tool.
{ name: 'n8n_update_variable', description: 'Update an environment variable', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Variable ID' }, key: { type: 'string', description: 'New variable key' }, value: { type: 'string', description: 'New variable value' }, type: { type: 'string', description: 'Variable type' }, }, required: ['id'], },