While the food would qualify as a defective and dangerous food product, there is no point in suing unless you've also sustained a demonstrable personal injury.
In other words, if you discovered the glass before eating it, a jury would likely react by saying "Thank G-d you found it before you ate it!" Since there was no serious injury they would not be inclined to awardyou a settlement for just finding a piece of glass in your food item.
On the other hand, if you indeed suffered internal or other injuries after consuming the food, then yes, you can (and probably should strongly consider) bring a defective products lawsuit.
In order to protect your claim, however, it would be advisable to contact a qualified attorney who handles defective products claims in New York soon after this occurs to help assure that critical evidence, among other things, are properly handled.