We present an analysis of the magnetic mechanism of an X6.4-class confined flare in NOAA Active Region (AR) 13590 on 2024 February 22. Despite a pre-existing magnetic flux rope (MFR) embedded within a null-point topology, the flare produced only a localized jet without an associated coronal mass ejection. Using data from the Solar Dynamics Observatory and nonlinear force-free field extrapolations, we traced the formation and evolution of the MFR, which developed under photospheric shearing motions but remained weakly twisted (with twist number being lower than 1.3) and below the thresholds for kink instability. Meanwhile, the MFR is located at heights where the decay index (n ≤ 1.0) of the overlying field was insufficient to trigger torus instability. Furthermore, we calculated two important parameters measuring the non-potentiality of the AR, one is the ratio of the free energy to the potential-field energy, and the other is the ratio of the non-potential helicity to the square of the magnetic flux. Both the two parameters were significantly lower than critical values for eruptive flares. These factors, combined with the stabilizing influence of the strong overlying field, confined the MFR and limited the eruption to a jet. Our findings highlight the importance of both local magnetic properties and global energy constraints in determining the eruptive potential of solar flares.