Upper endoscopy lets your doctor examine the lining of the upper part of your gastrointestinal tract, which includes the esophagus, stomach and duodenum (first portion of the small intestine). Your doctor will use a thin, flexible tube called an endoscope, which has its own lens and light source, and will view the images on a video monitor.