Sunan Ibn Majah 767
Grading supplied with this record: Sahih (Darussalam)
Narration text is preserved in its supplied Arabic and English. Translated interfaces and reading guides do not add narration translations in other languages.
مَنْ سَمِعَ رَجُلاً يَنْشُدُ ضَالَّةً فِي الْمَسْجِدِ فَلْيَقُلْ لاَ رَدَّ اللَّهُ عَلَيْكَ فَإِنَّ الْمَسَاجِدَ لَمْ تُبْنَ لِهَذَا "
It was narrated from Abu 'Abdullah, the freed slave of Shaddad bin Had that:
He heard Abu Hurairah say: "I heard the Messenger of Allah say: 'Whoever hears a man making a lost-and-found announcement in the mosque, let him say: "May Allah not return it to you!" For the mosques were not built for that.'"
Full reference and source
Sunan Ibn Majah 767 In-book : Book 4, Hadith 33 English translation : Vol. 1, Book 4, Hadith 767
View source on Sunnah.com (opens in a new tab)