Panglacial Wurm's ability works only while you're searching your own library. The effect that caused you to search needs to say "search" and "library," and you need to be looking through your own library for this to work. Examples of effects that let you cast Panglacial Wurm are Rampant Growth and Gifts Ungiven. Examples of effects that don't are Bribery and Sage Owl.