Involved in nitrogen metabolism via ammonium assimilation. Catalyzes the ATP-dependent biosynthesis of glutamine from glutamate and ammonia. 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. Conversely, when nitrogen levels are low, the N-terminal adenylyl removase (AR) of GlnE activates GlnA by removing the adenylyl group by phosphorolysis. The fully adenylated enzyme complex is inactive. Oligomer of 12 subunits arranged in the form of two hexagons. Belongs to the glutamine synthetase family.