An endoscopy is a test that uses a thin, lighted tube to see inside the body. This tube is called an endoscope. First the throat is numbed with an anesthetic spray. You may also be given medicine to help you relax. The tube is then passed through your mouth to the esophagus and stomach.