A magnesium blood test measures the amount of magnesium, an important mineral, in your blood. Your body needs magnesium from your diet to help your muscles, nerves, heart, and immune system work ...