Nonvolatile compact on-chip optical filters with a tunable spectral response are required in low-power optical communication systems and applications. By capping phase change materials (PCMs) films on a phase-shifted Bragg grating (PSBG), the key parameters of a filter such as center wavelength and extinction ratio can be tuned simultaneously for filtering or processing purposes. A 9 nm wavelength shift, and amplitude modulations of 16.1 dB in the transmission channel and 42.5 dB in the reflection channel while keeping the center wavelength unchanged are achieved in this filter at 1550 nm. Moreover, the device has a compact size of 500 nm 31.9 <inline-formula xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink"><tex-math notation="LaTeX">$\mu$</tex-math></inline-formula> m and an insertion loss as low as -0.76 dB, making it ideal for large-scale integration. The advent of such compact, reconfigurable, nonvolatile optical filters opens up new avenues for next-generation low-power general-purpose photonic integrated circuits (PICs) and has potential applications in wavelength division multiplexing (WDM) systems, spectral shaping, and on-chip signal processors.