Meaning: someone has the ability to think and make decisions (often used as a negative)
Example: The crazy man did not have all his marbles. Have you lost your marbles? Don't you know that poking a lion with a stick is dangerous?
See this Idiom in a story: Twas the Night Before Christmas