An esophagogastroduodenoscopy (EGD, also known as an upper endoscopy) is a procedure that enables your physician to examine the lining of the upper part of your gastrointestinal tract, which is the esophagus, stomach, and duodenum (the first portion of the small intestine), using a thin flexible tube with its own lens and light source.