Herbivorous fishes play a critical role in the maintenance of coral reefs through grazing and cropping of various benthic algae types. Herbivorous fish assemblages are sensitive to changes in the reef environment and are often targeted by local fisheries. This can lead to a decline in ecosystem functions if key groups are reduced. The present study investigates the morphological and ecological trait diversity of herbivorous reef fish assemblages in habitats differing in relative benthic coverage: i) coral-dominated, ii) algae-dominated, and iii) an intermediate habitat. Trait diversity for conspicuous herbivorous fishes was measured using three trait diversity indices: trait richness, trait divergence, and trait evenness. These indices were derived from in situ community surveys and feeding observations, morphological assessment of feeding mechanics from locally collected specimens, and ecological information obtained from published data. Trait diversity, reflected in higher trait evenness and lower trait richness, was lower within algae-dominated habitats than coral-dominated habitats, suggesting that algae-dominated habitats may be compromised by the lack of essential functions provided by key species. These groups reduce algal biomass and may help facilitate the survival and growth of corals, which in turn can increase coral cover. Algae-habitats were dominated with species known to consume macroalgae (rabbitfish and surgeonfish), appearing to provide essential feeding and habitat resources. These species include browsers and croppers that are fundamental in reducing algal biomass and may help facilitate the survival and growth of corals, which in turn can promote reef health. However, this habitat lacked parrotfishes known to remove turf algae and sediments, an essential function for clearing benthic space for coral settlement and other key benthic invertebrates. This study identified several species with overlapping functional roles in the coral-dominated and intermediate habitats. Still, species that were not redundant showed high trait complementarity, suggesting that their removal may result in the loss of unique functions. Importantly, we show that algae-dominated habitats supported high numbers of juvenile fishes especially in species targeted by local artisanal fishers. We also showed that the loss of trait diversity is greater than the loss of species diversity through the comparison of taxonomic and trait β-diversity, further emphasizing the importance of trait diversity analysis in understanding ecosystem health and maintenance.