It's hard to say what kind of worms you have without a better description and information. Are your plants indoors or out? How large are the worms? Are they on the soil surface or did you find them under the soil? Give me more to go on here and I'll try to help. The one thing I can tell you, however, is that they are not food for plants.