Using metal substrates that are nanoscale in size, surface-enhanced Raman scattering (SERS) is a technique for enhancing the Raman signal of biomolecules. Numerous industries including sensing materials, adsorption and medical devices, use nanomaterials like nanocages and nanoclusters. To discover a possible novel sensor platform involving a small metal cluster and a curved rigid substrate, we used density functional theoretical (DFT) simulations to explore the adsorption of glycoluril (GLC), a prospective drug intermediate, on a pure magnesium oxide cage (Mg12O12). This well defined cage was used as (i) an exact probable structure that could be used as well as (ii) a general model for MgO nanostructures. We also investigated the mono Al-doped Mg12O12 nanocage version Mg11AlO12. All computations were performed at the M06-2X level of theory. The GLC binds to the Mg12O12 nanocage by way of strong donor-acceptor interactions. The adsorption is releasing -45.80 kcal mol(-1) of energy. Due to Al doping, the energy gap of GLC-Mg11AlO12 (1.91 eV) is reduced from that of GLC-Mg12O12 (4.28 eV) and hence there is an increase in electrical conductivity of GLC-Mg11AlO12. The electronic change in the nanocage's conductivity can be transformed into an electrical signal which can be used to detect the presence of the drug analyte. In addition, when a GLC molecule is present, the work function of the nanocage is also reduced. The MgO nanocage, we conclude, is a work function type as well as a possible electronic sensor for GLC drug detection. GLC desorption from the Mg11AlO12 surface recovers more quickly in comparison with Mg12O12 recovery time. The AIM and NCIs assessed in this study were performed to help analyze the electronic structures of the complexes. Our findings pave the possibility for Mg11AlO12 nanostructures to be used in drug recognition.