In addition to diagnosis, gastroscopy can also be used for therapeutic purposes. For instance, it can be employed to remove small tumors, polyps, or foreign objects, treat bleeding ulcers, or dilate narrowed areas of the esophagus or duodenum. These interventions can be crucial in managing cancer and improving patient outcomes.