Ergotamine is an ergot alkaloid used to treat migraine headaches. Its primary mechanism of action in relieving migraine pain involves the constriction of dilated cranial blood vessels. Migraine is thought to involve vasodilation of cranial arteries, which contributes to the headache pain. Ergotamine acts as a non-selective 5-HT$_1$ receptor agonist, particularly at 5-HT$_{1B}$ receptors located on intracranial blood vessels, causing vasoconstriction. Additionally, ergotamine can have complex effects on other receptors, including adrenergic and dopaminergic receptors, and may also help reduce perivascular neurogenic inflammation, further contributing to migraine relief.