Storybook characters Contrary Mary, her brother Tom Tom, and their sweethearts Alan and Jane struggle to thwart the evil plans of Alan's Uncle Barnaby. In the process, they find themselves in the enchanting land of Toyland.
Act I: The unpopular Barnaby holds a party in the vain hope of winning the approval of the Piper family for his pursuit of Contrary Mary (even though she is in love with his own nephew, Alan). As he is driven off by the townspeople, he brags about inheriting the fortunes of Alan and his sister Jane, who—he says—have died in a storm at sea. Shortly after Mary’s brother Tom Tom sets off in search of them, Alan and Jane appear, disguised. Alan is mistakenly convinced that Mary no longer loves him, they argue, and Mary runs away. Barnaby, determined to marry her, pursues.
All follow Mary to Toyland. Barnaby hires Inspector Marmaduke to find her and the Toymaker gives the young Piper children toys. While the rest of the Piper children search for their sister Mary, Jill meets Grumio, the Toymaker's Apprentice. He saves her doll from Barnaby, and, with one look, he and Jill fall in love. Barnaby asks the Toymaker if he can make toys that will hurt children. Jane overhears and realizes that her uncle is trying to kill her and Alan in order to get their money. They must flee Toyland. Jill takes them to the Toymaker’s shop to change into disguises their uncle will not recognize. They find Mary there, and Grumio agrees to help them escape. First, though, he wants Alan to pose as a wooden soldier and lead the parade of toys.
Act II: The toy shop bustles to prepare a shipment that will include Jane and Alan. Grumio plans to get them out of Toyland, disguised as toys. Barnaby enters and asks the Toymaker if he has considered his offer. Mary barely escapes his view. She confesses to Alan, who is posing as a doll, that she loves him and is sorry for everything. They are interrupted by the Toymaker who reveals his book of dark magic and begins the incantation to bring his dolls to life. Alan sees that the toys are moving toward the Toymaker with intentions to kill him. He tries to warn the Toymaker, who dismisses him as an ungrateful toy. Although Alan breaks the enchantment, the Toymaker has already died. Barnaby arranges for Alan to be arrested for the Toymaker’s murder.
Alan escapes from the police station and runs off with Mary. Tom Tom informs Jane that the King of Toyland will convict Alan without a hearing. Grumio and Jill enter, soon followed by Alan and Mary who are both in disguise. Barnaby enters and sees through their disguises. When Alan goes to the passport office, Barnaby reveals himself to Mary. He tells her that he knows all, and will turn Alan over to be executed unless she marries him. Gonzorgo and Roderigo present a document stating that Alan will be executed. Mary agrees to marry Barnaby in order to save Alan’s life. Jane arrives to find that Mary is now Barnaby’s wife and that Alan (betrayed by Barnaby after all) has been arrested and is about to be executed. Luckily, Tom Tom enters and reveals an old Toyland law. Alan could be spared if a widow of Toyland wants to claim him for her husband. A group of widows enter to look Alan over but none is taken with him. Gonzorgo and Roderigo, hoping to spare Alan a horrible execution, convince him to drink a glass of poisoned wine that will put him to sleep before he steps up to the scaffold. Everyone has come to watch Alan’s execution. Tom Tom stops the action to announce that he has found another widow, his mother. But she, it emerges, has already married Inspector Marmaduke. Barnaby, victorious, drinks the poisoned wine prepared for Alan and dies. Now a widow, Mary instantly claims Alan as her husband.