In this paper, we present a novel ultrashort pulse shaper based on complex-modulated long-period-grating coupler (CM-LPGC). Temporal rectangular waveform with 2-ps full width at half maximum (FWHM) is obtained by transforming the input Gaussian pulse. Tolerances of the CM-LPGC-based shaper to various non-ideal excitation conditions and fabricating errors are investigated. Results confirm that CM-LPGC is stable and suitable for optical pulse shaping operation.