undo everything my tool does

I’m working on a tool that does lots of different stuff. Undo is undoing each of these steps one by one. I’d like to be able to “collect” everything into one undo operation, say “Undo MyTools stuff”.

Is that possible?