During an upper endoscopy or EGD, a flexible, thin lighted tube called an endoscope is inserted into the mouth. This allows the physician to look inside the esophagus, stomach and duodenum (first part of the small intestine). This procedure may be performed to find the causes for swallowing difficulties, nausea, vomiting, reflux, bleeding, indigestion, abdominal pain, or chest pain.