Answer :

There's no defined Primary mission, but really they're the replacement (along with NATO) to the League of Nations formed after WW1. The UN try to maintain world peace and stop terrorism. In many ways, you could call them a world police.
To preserve peace through international cooperation