Ultracompact minihalos (UCMHs) are dense dark matter structures which can form from large density perturbations shortly after matter-radiation equality. If dark matter is in the form of Weakly Interacting Massive Particles (WIMPs), then UCMHs may be detected via their gamma-ray emission. We investigate how the Fermi satellite could constrain the abundance of UCMHs and place limits on the power spectrum of the primordial curvature perturbation. Detection by Fermi would put a lower limit on the UCMH halo fraction. The smallest detectable halo fraction, fUCMH > ∼ 10 −7 , is for MUCMH ∼ 10 3 M⊙. If gamma-ray emission from UCMHs is not detected, an upper limit can be placed on the halo fraction. The bound is tightest, fUCMH < ∼ 10 −5 , for MUCMH ∼ 10 5 M⊙. The resulting upper limit on the power spectrum of the primordial curvature perturbation in the event of non-detection is in the range PR < ∼ 10 −6.5 − 10 −6 on scales k ∼ 10 1 − 10 6 Mpc −1 . This is substantially tighter than the existing constraints from primordial black hole formation on these scales, however it assumes that dark matter is in the form of WIMPs and UCMHs are not disrupted during the formation of the Milky Way halo.