Thanks for posting your query.
Do you abdominal pain/ constipation/ fever in past?
Does your abdominal pain gets relieved after defecation?
Do you have some sort of anxiety?
Presence of mucus along with history of diarrhea may be Irritable bowel syndrome
Irritable bowel syndrome is functional disorder
of intestinal tract in which patient's intestine gets hyper responsive to sort of stress.
Worm infestation is unlikely with mucus discharge.
You should consult with internal medicine specialist/ gastroenterologist and should go for thorough check up.
You should also go for stool examination along with colonoscopy
evaluation of large intestine).
Dr. Mayank Bhargava