I heard the Messenger of Allah (May peace be upon him) as saying; if anyone hears a man crying out in the mosque about something he has lost, he should say: May Allah not restore it to you, for the mosque were not built for this. (Using translation from Abū Dāʾūd 473)
سَمِعْتُ رَسُولَ اللَّهِ ﷺ يَقُولُ «مَنْ سَمِعَ رَجُلًا يَنْشُدُ ضَالَّةً فِي الْمَسْجِدِ فَلْيَقُلْ لَا أَدَّاهَا * اللَّهُ عَلَيْكَ فَإِنَّ الْمَسَاجِدَ لَمْ تُبْنَ لِهَذَا»