From the Super Mario Wiki
The Magnifying Glass is a Special Item used for finding Red Coins in Super Mario World 2: Yoshi's Island and its remake Yoshi's Island: Super Mario Advance 3. Magnifying Glasses can be found in any of the Bonus Challenge games and when used, its effects continue until Yoshi either loses a life or reaches the end of a level. The Magnifying Glass detects Red Coins that are disguised as Gold Coins and turns them red and visible to the Yoshi so he may more easily collect all twenty Red Coins in the level. The Magnifying Glass will also reveal Winged Clouds that are otherwise invisible, except Winged Clouds that are only revealed by rolling a Chomp Rock or Snowball over their location.
In Paper Mario: Sticker Star, the Magnifying Glass is a thing first found in the Sandshifter Ruins. It can also be bought from the Shady Toad in Decalburg. In battle, the Magnifying Glass intensifies the sun's rays on enemies, causing burn damage.
The Magnifying Glass Thing returns as a card in Paper Mario: Color Splash. It can be found in the Tangerino Grill's freezer or bought from the Wringer in Port Prisma for 200 coins. In battle, rather than burning enemies with the sun's rays, it instead enlarges Mario so he can trample enemies.
Yoshi's Island: Super Mario Advance 3
Names in other languages