Recently, the 1.4 feV ultranarrow nuclear transition at 12.4 keV energy in ^{45}Sc was resonantly excited for the first time using radiation from the self-seeded EuXFEL laser [Y. Shvyd'ko et al., Resonant x-ray excitation of the nuclear clock isomer ^{45}Sc, Nature (London) 622, 471 (2023)NATUAS0028-083610.1038/s41586-023-06491-w], establishing ^{45}Sc as a promising candidate for a future Mössbauer nuclear clock. While this experiment demonstrated a high potential of x-ray free-electron laser sources for resonantly exciting nuclear isomers in the hard x-ray range, it also highlighted a severe limitation in the achievable excitation level caused by their extremely large spectral bandwidth ∼1 eV. In this Letter, we propose a method to enhance the spectral flux of x-ray free-electron laser radiation using a resonant absorber with a longitudinal gradient in the nuclear transition frequency. A portion of the incident pulse can be absorbed into a nuclear collective excitation, and converted back into x-ray radiation by reversing the sign of the frequency gradient. Spectral narrowing and flux enhancement of this re-emitted x-ray field is achieved by using a reversed frequency gradient with a smaller magnitude than the initial one. About a hundredfold of such spectral flux enhancement is feasible in ^{45}Sc_{2}O_{3} single crystal, rendering a more efficient source for nuclear excitation and facilitating the experimental observation of resonant fluorescence and coherent forward scattering at the 12.4 keV transition, both of which are essential for realizing a nuclear clock.