A magnesium-decorated graphene quantum dot (C24H12-Mg) surface has been examined theoretically using density functional theory (DFT) computations at the ωB97XD/6-311++G(2p,2d) level of theory to determine its sensing capability toward XH3 gases, where X = As, N and P, in four different phases: gas, benzene solvent, ethanol solvent and water. This research was carried out in different phases in order to predict the best possible phase for the adsorption of the toxic gases. Analysis of the electronic properties shows that in the different phases the energy gap follows the order NH3@C24H12-Mg < PH3@C24H12-Mg < AsH3@C24H12-Mg. The results obtained from the adsorption studies show that all the calculated adsorption energies are negative, indicating that the nature of the adsorption is chemisorption. The adsorption energies can be arranged in an increasing trend of NH3@C24H12-Mg < PH3@C24H12-Mg < AsH3@C24H12-Mg. The best adsorption performance was noted in the gas phase compared to the other studied counterparts. The interaction between the adsorbed gases and the surfaces shows a non-covalent interaction nature, as confirmed by the quantum theory of atoms-in-molecules (QTAIM) and non-covalent interactions (NCI) analysis. The overall results suggest that we can infer that the surface of the magnesium-decorated graphene quantum dot C24H12-Mg is more efficient for sensing the gas AsH3 than PH3 and NH3.