Diagnosis typically involves a blood test to measure serum magnesium levels. However, it's important to note that serum levels may not always reflect total body magnesium stores. In some cases, additional tests such as a 24-hour urine collection may be necessary.