Upper GI endoscopy is a test that looks inside your upper GI tract. During the test, a biopsy or tissue sample is sometimes taken and studied for problems.