'Returns information about the most recently used tool.'

@web.expose
@web.require_login('to    get    most    recently    used    tool')
@web.json_pretty
def get_most_recently_used_tool_async(self, trans):

    query = trans.sa_session.query(self.app.model.Job.tool_id).join(self.app.model.History).filter((self.app.model.History.user == trans.user)).order_by(self.app.model.Job.create_time.desc()).limit(1)
    tool_id = query[0][0]
    tool = self.get_toolbox().get_tool(tool_id)
    tool_info = {'id': tool.id, 'link': url_for(controller='tool_runner', tool_id=tool.id), 'target': tool.target, 'name': tool.name, 'minsizehint': tool.uihints.get('minwidth', (-1)), 'description': tool.description}
    return tool_info
