SSH connection – How to get algorithm for SFTP server before connection creation

Trying to connect to SFTP server, here is the connect code in NodeJS:

var conn = new ssh2();
    ......
    conn.connect(
        {
            "host": sftpHost,
            "port": sftpPort,
            "username": sftpUserName,
            // Trying to find "algorithm" value for the target SFTP server.
            "algorithms": {serverHostKey: ['ssh-dss'] }, 
            "password": sftpPassworde                 
        }

But the value of “algorithm” parameter is different for different SFTP servers. Is there any existing function available in sftp package using which we can get the value of Algorithm used on target SFTP server and pass dynamic value for this parameter?