If it's near the end, it could very well be just his anal glands emptying - which is a good benefit of hard poos. Maybe just keep an eye on it for couple days? If it persists, maybe go in? When the mucous is "around/throughout" the poo, it can a bit more of a warning sign.
^^^And, as in BrowniesMom, a great clue for a tuned-in Mom!