I've had low magnesium levels for decades due to undiagnosed insulin resistance and then 2 years of severe magnesium deficiency due to surgery and then taking high doses of vitamin D. I had over 50 + symptoms including a calcified mitral heart valve but no kidney stones.
I drink a LOT of water (thirst is one of my symptom of insulin resistance and this symptom worsened when I had severe magnesium deficiency). Dehydration is the major cause of kidney stones. If you already have the kidney stone/s, then magnesium helps because this mineral dissolves calcium (the most common type of kidney stone is calcium oxalate).
Ive had kidney stones now for 15 years and have seen three urologists but not one of them has ever tried to find out the cause. As soon as they see the xrays its like straight to hospital for lithotripsy (blasting) or have them taken out surgically and have had several stents. I am over it. Going to see another GP today to see if he can perhaps find the cause. I have researched and found that low magnesium can be a cause so will talk to the dr and see what he thinks. Also I have researched the parathyroid, check it out, very interesting read.