General anesthesia prevents normal temperature regulation of the body and rats are so small they lose body heat rapidly. If warmth is not supplied, for instance by a heating pad, they can easily die from hypothermia. Warmth is also needed for several hours after the surgery. Only inhalant anesthetics should be used for rats. This is so the level of anesthesia can be carefully controlled.
Injectable anesthetics can be dangerous for rats.
Discuss this with your vet. If a rat is at high risk for anesthesia, for instance rats with congestive heart failure, minor surgery such as tumor removals can be done by sedating the rat with butorphanol and dipping the scalpel in local anesthetic while someone holds the rat. It's important to give antibiotics after surgery to prevent infection, and this is especially recommended for neuters, major surgeries, or if a rat has other health problems. If a rat who has had an active mycoplasma infection needs surgery, you should put her on antibiotics suitable for mycoplasma several days before the surgery to help protect her against a relapse of the mycoplasma during the stress of surgery. Continue giving the antibiotics until after the incision has healed.