FWIW Magnesium prevents kidney stones in humans and calcium causes them (especially in diets lacking vitamin D3 and Vitamin K2).
And, fun fact, the opposite is true in cats -- magnesium causes kidney stones. "The More You Know"
Source: https://www.lifeextension.com/protocols/kidney-urinary/kidney-stones
"Higher magnesium consumption, and especially magnesium citrate, is significantly associated with lower risk of calcium oxalate kidney stones. In order to bind dietary oxalate, magnesium must be taken at the same time as oxalate-containing foods." ibid
Also I've been eating a lot of starfruit and spinach, both of which are oxalate containing foods, so I need to remember to eat / take magnesium at the same time as those. Whoops