Urbanization is a leading threat to biodiversity, but scientifically informed management of urban ecosystems can mitigate negative impacts. For wild bees, which are declining worldwide, careful consideration of flower choice in private and public green spaces could help preserve their diversity. While floral density and species richness are both linked to wild bee diversity, the mechanisms underlying these relationships remain poorly understood. Here, I tested two hypotheses relating the influence of floral trait composition to bee species richness, which I have termed the floral trait diversity and optimal floral trait hypotheses. To test my hypotheses, I assessed whether within-site variation in bee richness relates to variation in floral trait composition in urban green spaces across the city of Montreal, Canada. In addition to surveying flower species richness and floral density, I measured two floral traits which relate to pollinator feeding success, nectar sugar concentration and corolla length, as feeding is the main use of flowers by bees and therefore likely to impact their communities. After accounting for variation in floral density, I found that bee richness was positively related to community-wide variation in corolla length, supporting the floral trait diversity hypothesis. These findings suggest that although flower abundance and richness affect wild bee richness in urban ecosystems, the composition of flower morphologies can further shape pollinator communities. I conclude that an understanding of these mechanisms can positively impact conservation of urban wild bee communities.