Is magnesium mandated for cramps?

Answer: Magnesium supplements are well tolerated and often recommended to prevent cramps, but there is no evidence that they provide a clinical benefit other than for pregnancy-related leg cramps. 1,2 

A subgroup analysis of pregnant women from a meta-analysis of studies in a general adult population showed magnesium significantly reduced the median number of leg cramps experienced per week compared to placebo. The overall analysis did not show a significant effect of magnesium for leg cramps across all participants. 1