Upper endoscopy. A thin, lighted tube is inserted through the mouth to look for abnormal areas in the esophagus, stomach, and first part of the small intestine.