Gastroscopy, also known as an upper gastrointestinal endoscopy, is a medical procedure that allows physicians to examine the lining of the upper part of the gastrointestinal tract, which includes the esophagus, stomach, and the first part of the small intestine. This procedure is carried out using a flexible tube called an endoscope, which has a light and a camera at its tip to capture images of the gastrointestinal tract.