Signs of a deficiency include fatigue, chronic inflammation, unsteady blood sugar, and leg cramps, as well as mood swings, headache, and an irregular heartbeat. If you suspect you have a magnesium deficiency, your doctor can order you a serum magnesium blood test, urinary magnesium excretion test, or magnesium retention to be sure.