Endoscopy uses a flexible tube to examine the upper gastrointestinal tract, including the oesophagus, stomach, and proximal duodenum. This procedure is typically performed if your doctor suspects conditions such as oesophageal inflammation, ulcers, or abnormalities in the oesophagus, stomach, or duodenum.