The harassment-type claim would be malicious prosecution or abuse of process; although, those types of claims often are not brought until after the original (harassing) suit is dismissed. But, at least in some states, you can file them as a counterclaim. In that case, the fact that they retract or have their suit dismissed probably helps your claim. Of course, your damages are probably limited if the claim is retracted or dismissed at an early stage.
Another potential is to not file a counterclaim, but seek attorney fees and costs for having to defend a frivolous/groundless suit. In Colorado, if you win on a 12(b) Motion (i.e. you fail to state a claim) you get your attorney fees and costs as a matter of statute. We also have a specific frivolous/groundless statute that permits recovery of attorney fees and costs outside of the 12(b) context. I'm not sure if other states have the 12(b) type statute, but most states have a Rule 11 / frivolous-groundless type statute that allows the recovery of those damages.
Many states also have a Rule 11 (a rule that requires the filing attorney to basically have done their due diligence and have a factual basis for the filing) safe haven. In that scenario, you send a letter to the opposing counsel saying you have no claim. They then get a certain amount of time to withdraw their claim without facing fees.