Uncanny dodge is a reaction that can be used against any attacks that hit you as long as you can see them. spells can still be affected by it as long as they require a attack roll. If a spell has an attack roll, uncanny dodge works. If there's no attack roll, to bad, it doesn't works.
Uncanny dodge makes it so that, if you can see the attack, you only take half of the damage. It works even if you're grappeled. the only weakness is that since it's a reaction, you can't use it against multiple simultanus attacks, only one will have its damage divided by two. If you have good health (I have 75hp in this example) and good armor (24 AC for me), you can tank better than a paladin, especially against a boss.