The closing and reopening vote are only intended to annul the votes already given. Is that kind of action correct?
It doesn’t seem incorrect. Questions with close votes tend to attract more close votes, so a question that’s one vote away from closure stands a pretty good chance of getting there. If a moderator looks at such a question and sees either that the problem with the question has been addressed, or that the votes seem inappropriate for some other reason, then it might make sense to close and reopen the question. Basically, if a mod looks at a question and thinks that they’d reopen it if it were closed, then it makes sense to take similar action immediately instead of waiting for the closure to happen.
Moderator time is a scarce resource, so if they can solve a problem preemptively and thereby reduce the number of times they have to visit the question, that seems like a good thing.
That said, I’m confident that mods don't go looking to subvert the users. We’re all on the same team here, and the moderators rely on the community to handle most of the issues.
it explicitly asked if there was a tool that performs a certain specific task
Go back and look at the question to which you’re referring. Do you think that it should be closed in its current state? If no, then it sounds like you’re in agreement with the moderator, and the right thing happened. If yes, then there’s a mismatch between your understanding of which questions deserve to be closed and the mod’s; ask about the question in Meta to get a better understanding.
Note also that there are particular reasons for some of the “rules” about what is or isn’t acceptable. Questions like Is there a tool for X? are frowned on because that’s close to asking for a resource recommendation, and based on experience we don’t want the site to devolve into a recommendation site. But if someone is asking *whether* a tool exists, it’s probably because they have a problem, and we have lots and lots of questions of the form How can I solve problem X? So it’s often possible to convert a borderline question into a good one.