A hysteroscopy is primarily performed for diagnostic or therapeutic purposes related to the uterus. From a diagnostic perspective, it's used to investigate issues such as abnormal uterine bleeding, unexplained infertility, or recurrent miscarriages. It can also be utilized to detect conditions like uterine polyps, fibroids, or structural abnormalities. Therapeutically, a hysteroscopy can treat many of these conditions by removing polyps, fibroids, or adhesions, and it can also be used to place an intrauterine device or perform endometrial ablation. Thus, a hysteroscopy serves as a vital tool in managing various uterine conditions effectively.