The prosecution says Mr Nyanja did not get the county's approval for the building.
Former Limuru legislator George Nyanja has denied firing at Nairobi government officials in an attempt to stop the demolition of his building in Karen, Nairobi County.
A charge sheet states that Mr Nyanja fired a Ceska pistol last Wednesday at Mr Fredrick Ondari, an inspector of buildings, who led others in tearing down the illegal structure.
Mr Nyanja denied the charge on Wednesday before Kibera Senior Principal Magistrate Faith Mutuku and was released on Sh200,000 cash bail.
The case will be heard on November 15.
Nyanja presented himself to court on Tuesday but did not take plea after a prosecutor found the charge sheet faulty.
Prosecutor Charles Mogaka's request for the plea-taking to be deferred was granted and the accused's police bail of Sh50,000 extended to Wednesday.
The prosecution said the former Member of Parliament did not get the county's approval for the construction.
Earlier, Nairobi County’s Chief Media Officer, Mr Elkana Jacob, said the building was constructed without approval and that residents were also opposed to it.