An upper gastrointestinal (UGI) endoscopy is a procedure that allows your doctor to look at the interior lining of your esophagus, your stomach, and the first part of your small intestine (duodenum) through a thin, flexible viewing instrument called an endoscope. The tip of the endoscope is inserted through your mouth and then gently moved down your throat into the esophagus, stomach, and duodenum (upper gastrointestinal tract).