Cabergoline is a dopamine agonist that primarily works by reducing prolactin secretion from the pituitary gland.