The recent discovery of a $gamma$-ray counterpart to a gravitational wave event has put extremely stringent constraints on the speed of gravitational waves at the present epoch. In turn, these constraints place strong theoretical pressure on potential modifications of gravity, essentially allowing only a conformally-coupled scalar to be active in the present Universe. In this paper, we show that direct detection of gravitational waves from optically identified sources can also measure or constrain the strength of the conformal coupling in scalar--tensor models through the time variation of the Planck mass. As a first rough estimate, we find that the LISA satellite can measure the dimensionless time variation of the Planck mass (the so-called parameter $alpha_M$) at redshift around 1.5 with an error of about 0.03 to 0.13, depending on the assumptions concerning future observations. Stronger constraints can be achieved once reliable distance indicators at $z>2$ are developed, or with GW detectors that extend the capabilities of LISA, like the proposed Big Bang Observer. We emphasize that, just like the constraints on the gravitational speed, the bound on $alpha_M$ is independent of the cosmological model.