Ergotamine tartrate is primarily used to treat or prevent certain types of headaches, including vascular headaches such as migraines and cluster headaches. It works by narrowing widened blood vessels in the head, which can reduce the throbbing effects that characterize these conditions.