Sahih Muslim · Hadith 1291
The Book of Mosques and Places of Prayer - كتاب الْمَسَاجِدِ وَمَوَاضِعِ الصَّلاَةِ
حدثنا أبو بكر بن أبي شيبة، حدثنا وكيع، عن أبي سنان، عن علقمة بن مرثد، عن سليمان بن بريدة، عن أبيه، أن النبي صلى الله عليه وسلم لما صلى قام رجل فقال من دعا إلى الجمل الأحمر فقال النبي صلى الله عليه وسلم " لا وجدت إنما بنيت المساجد لما بنيت له " .
Sulaiman b. Buraida reported on the authority of his father that when the Apostle of Allah (may peace be upon him) had said prayer a man stood up and said: Who called for a red camel? (Upon this) the Apostle of Allah (may peace be upon him) said: May it not be restored to you! The mosques are built for what they are meant.
Gradings are classical jarḥ-wa-taʿdīl, name-matched to a rijāl index (not individually re-verified).