In the tale, Princess Ozma takes the Wizard on an inspection tour of her kingdom; she wants to know if any of her subjects are troubled or discontented. In a remote corner of the land, the two learn that the local people are annoyed by the pranks and harassment of a trio of imps, who live in caves in the hills nearby. They are called Olite, Udent, and Ertinent. (Their names are puns: Imp Olite, etc.)
Ozma and the Wizard confront the imps, who treat them as rudely as everyone else. The Wizard employs his magic to transform the imps, first into bushes, then white piglets, then blue doves. Yet each time the imps find ways to strike back at the Ozian authority figures. The result is more slapstick humor than is usual is Baum's Oz fiction; even the normally staid Ozma gets knocked around.
The Wizard solves the problem by transmogrifying the imps into purely inanimate objects — three buttons, of tin, brass, and lead. The Wizard plans to wear the buttons on his coat; and when they transform into silver, gold, and aluminum respectively, the Wizard will know that the imps have repented and reformed.