Normal dog or puppy feces are not coated in cloudy, yellow or green mucus. The mucus is a sign that the dog's digestive system is irritated. The dog and a recent stool sample need to go to a veterinarian.
A dog's intestines use mucus as a lubricant to push out feces and anything else that happens to be in there. Normal, healthy mucus is transparent. Large amounts of colored mucus indicate that the dog's intestines are having trouble getting rid of an irritant.
Causes of mucus in a dog's stool are often due to colon cancer; food allergies; pancreatitis or colitis, which is caused by parasitic infestation such as whipworms; a fungal infection or swallowing a foreign object like a pebble or toy.
Other symptoms the dog may have that can help to diagnose the problem include bright red or black blood in the stool, passing more gas than usual, sudden weight loss, sudden loss of energy or diarrhea.
Worm eggs can usually be seen under a microscope in the dog's feces. The veterinarian will need to do a rectal exam, especially if a tumor is suspected. Some dogs may need an X-ray or a biopsy to determine the cause of the irritation.
Treatment depends on the cause. Worming medicine can kill parasites; surgery gets rid of stubborn foreign objects and antibiotics can help with infections. Cancer, pancreatitis or food allergies have more complex treatments, depending on severity.