They capture harmful metabolites from the hemolymph and direct them to the cloaca, from where they escape through the anus.