It shall be the duty of the city attorney to prosecute and defend suits for and against the city; to serve as legal advisor to the mayor, councilmen, city manager and other city officials with respect to the affairs of the city; to draw all legal documents relating to the affairs of the city; to draw proposed ordinances when requested to do so; to inspect and pass on the legality and form of all agreements, contracts, franchises, and other instruments with which the city may be concerned; to attend meetings of the mayor and council; and to perform such other duties as may be required of him by virtue of his position as city attorney.