delete_variable
Remove a variable from n8n workflows by specifying its ID to manage workflow data and configurations.
Instructions
Delete a variable by ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes |
Implementation Reference
- src/index.ts:478-481 (handler)MCP tool handler function that executes the delete_variable tool by calling n8nClient.deleteVariable and formatting the success response.private async handleDeleteVariable(args: { id: string }) { await this.n8nClient.deleteVariable(args.id); return { content: [{ type: 'text', text: JSON.stringify(jsonSuccess({ id: args.id }), null, 2) }] }; }
- src/index.ts:187-187 (schema)Input schema definition for the delete_variable tool, provided in the list_tools response.{ name: 'delete_variable', description: 'Delete a variable by ID', inputSchema: { type: 'object', properties: { id: { type: 'string' } }, required: ['id'] } },
- src/index.ts:285-286 (registration)Registration in the CallToolRequestSchema handler switch statement that routes delete_variable calls to the handler method.case 'delete_variable': return await this.handleDeleteVariable(request.params.arguments as { id: string });
- src/n8n-client.ts:728-731 (helper)Helper method in N8nClient that performs the actual HTTP DELETE request to the n8n API endpoint /variables/{id}.async deleteVariable(id: string): Promise<{ ok: boolean }> { await this.api.delete(`/variables/${id}`); return { ok: true }; }