Involved in nitrogen metabolism via ammonium assimilation. Catalyzes the ATP-dependent biosynthesis of glutamine from glutamate and ammonia (PubMed:7937767, PubMed:12819079). Also able to use GTP (PubMed:7937767). D-glutamate is a poor substrate, and DL-glutamate shows about 50% of the standard specific activity (PubMed:7937767). Also plays a key role in controlling the ammonia levels within infected host cells and so contributes to the pathogens capacity to inhibit phagosome acidification and phagosome-lysosome fusion (PubMed:7937767, PubMed:12819079). Involved in cell wall biosynthesis via the production of the major component poly-L-glutamine (PLG) (PubMed:7937767, PubMed:10618433). PLG synthesis in the cell wall occurs only in nitrogen limiting conditions and on the contrary high nitrogen conditions inhibit PLG synthesis (Probable). ATP + L-glutamate + NH4(+) = ADP + H(+) + L-glutamine + phosphate Binds 2 Mg(2+) ions per subunit. When cellular nitrogen levels are high, the C-terminal adenylyl transferase (AT) of GlnE inhibits GlnA by covalent transfer of an adenylyl group from ATP to Tyr-406 (PubMed:15037612). Conversely, when nitrogen levels are low, the N-terminal adenylyl removase (AR) of GlnE activates GlnA by removing the adenylyl group by phosphorolysis (PubMed:15037612). The fully adenylated enzyme complex is inactive (Probable). Also inhibited by the diketopurine analog 1-[(3,4-dichlorophenyl)methyl]-3,7-dimethyl-8-morpholin-4-yl-purine-2,6-dione, EDTA, and by L-methionine-SR-sulfoximine (MSO) (PubMed:7937767, PubMed:12496196, PubMed:19695264). Optimum pH is 7.5 in the presence of magnesium and cobalt ions (PubMed:7937767, PubMed:19695264). Optimum pH is 7 in the presence of manganese ions (PubMed:7937767). Oligomer of 12 subunits arranged in the form of two hexagons. Repressed by phosphorothioate modified antisense oligodeoxyribonucleotides (PS-ODNs), which acts against the mRNA of glutamine synthetase. Cells lacking this gene do not show a detectable glutamine synthetase activity and is auxotrophic for L-glutamine. This mutant is also attenuated for intracellular growth in human THP-1 macrophages and avirulent in the highly susceptible guinea pig model of pulmonary tuberculosis. Belongs to the glutamine synthetase family.