sftp problem

Hi I need to perform the following task using shell script.

establishing a sftp connection to a server.
then get the latest file from there to our own server.

But i am not finding ny suitable command in sftp console to get the latest file.
can anyone help me in this reagrd.
if ny other procedure can help please suggest those also.

You will need to read the dates of the files and decide yourself which is the latest file.

Alternatively use ssh to run ls remotely to do a sorted listing based on date then retrieve that file.