In the blood, only a small amount of magnesium is present in the body. Magnesium is required for several chemical reactions in the body. This test is done after your health-care provider suspects you have an abnormal amount of magnesium in your blood. It helps maintain normal muscle and nerve function, as well as helping to keep bones healthy. It is also important for the heart to function properly and to help regulate blood pressure. It also helps the body monitor blood sugar levels and supports the immune system (immune) system. The other half of the body tissue and organs are found inside cell walls.