Infection of the endocrine glands with species of mycobacterium, most often mycobacterium tuberculosis. The disease is Monarch Disease Ontology id MONDO_0006743 (endocrine tuberculosis).