An upper endoscopy, also known as esophagogastroduodenoscopy (EGD), is a procedure that enables your doctor to examine the lining of your esophagus (swallowing tube), stomach and duodenum (the first part of the small intestine). A soft, flexible fibre optic tube is passed through the nose into the esophagus. The esophagus, stomach and duodenum are carefully inspected and a biopsy (a small piece of tissue) may be taken.