The mRNA vaccines were very good at preventing any infection, between 80% and 95% effective depending on variant and study. J&J was between 65 and 80% depending on the variant and study. All of them have been excellent at preventing hospitalization and death.
And they definitely were advertised as helping to prevent the spread. That's the whole "herd immunity" thing. After all, one goal is to prevent the epidemic from hitting the unvaccinated.