Mosques and places of Prayer - Section 1 Mishkat al-Masabih 706

Arabic hadith text
وَعَنْ أَبِي هُرَيْرَةَ رَضِيَ اللَّهُ عَنْهُ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ:" مَنْ سَمِعَ رَجُلًا يَنْشُدُ ضَالَّةً فِي الْمَسْجِدِ فَلْيَقُلْ: لَا رَدَّهَا اللَّهُ عَلَيْكَ فَإِنَّ الْمَسَاجِد لم تبن لهَذَا ". رَوَاهُ مُسلم
Translation

Abu Huraira reported God's Messenger as saying, “If anyone hears a man crying out in the mosque about something he has lost, he should say, ‘May God not restore it to you,’ for the mosques were not built for this.” Muslim transmitted it.