We discuss the problem of prescribing localized perturbations of the scalar curvature of a Riemannian metric. Such a problem arises in constructions of solutions to the Einstein constraint equations. Recent joint work with Michael Eichmair (ETH) and Pengzi Miao (Univ. Miami) studies the problem of localized perturbation of scalar curvature with a volume constraint. The obstruction to such perturbation is a generalized static potential which can be interpreted variationally. As an application, we obtain a localized gluing (connect-sum) result for constant scalar curvature metrics, preserving total volume.