In this work, we prepared a novel electrochemical sensor for the detection of tramadol based on a UiO-66-NH2metal–organic framework (UiO-66-NH2MOF)/third-generation poly(amidoamine) dendrimer (G3-PAMAM dendrimer) nanocomposite drop-cast onto a glassy carbon electrode (GCE) surface. After the synthesis of the nanocomposite, the functionalization of the UiO-66-NH2MOF by G3-PAMAM was confirmed by various techniques including X-ray diffraction (XRD), energy-dispersive X-ray spectroscopy (EDS), field emission-scanning electron microscopy (FE-SEM), and Fourier transform infrared (FT-IR) spectroscopy. The UiO-66-NH2MOF/PAMAM-modified GCE exhibited commendable electrocatalytic performance toward the tramadol oxidation owing to the integration of the UiO-66-NH2MOF with the PAMAM dendrimer. According to differential pulse voltammetry (DPV), it was possible to detect tramadol under optimized circumstances in a broad concentration range (0.5 μM–500.0 μM) and a narrow limit of detection (0.2 μM). In addition, the stability, repeatability, and reproducibility of the presented UiO-66-NH2MOF/PAMAM/GCE sensor were also studied. The sensor also possessed an acceptable catalytic behavior for the tramadol determination in the co-existence of acetaminophen, with the separated oxidation potential of ΔE = 410 mV. Finally, the UiO-66-NH2MOF/PAMAM-modified GCE exhibited satisfactory practical ability in pharmaceutical formulations (tramadol tablets and acetaminophen tablets).