This book follows siblings Jack and Annie on a time-traveling adventure. In the Frog Creek, Pennsylvania, woods, a magic tree house allows them to travel to any time and place by pointing at a picture in a book. No time passes at home while they are gone. The tree house belongs to Morgan le Fay, a magical librarian from the legendary realm of Camelot, and the children have completed many missions for Morgan and her friend Merlin the magician. Merlin has tasked them with learning four "secrets of greatness" from famous historical figures. They have already completed three missions, meeting Alexander the Great, Harry Houdini, and Florence Nightingale. They now await their fourth and final mission.
Before dawn, Annie wakes Jack, telling him the tree house has returned. In it, they find a sheet of paper listing the three secrets they have already collected: humility, hard work, and meaning and purpose. Beside it lie a scroll from Merlin, a gold ring called the Ring of Truth that glows when a secret of greatness is discovered, a small bottle of magic mist gathered on the magical island of Avalon, and a World Cup program with two purple tickets to the 1970 World Cup Final in Mexico City. The mist grants one hour of extraordinary talent to whoever breathes it in and makes a wish. The scroll instructs them to learn the fourth secret from Pelé the Great, the legendary Brazilian soccer player. Jack takes the ring and the mist, Annie pockets the tickets, and Jack wishes them to Mexico City, 1970.
They land near the U.S. Embassy in hot, smoggy Mexico City. A friendly embassy guard named Benny tells them the final match, Italy versus Brazil, starts at noon at Aztec Stadium, about ten miles south. He writes down metro directions and notes their tickets are among the best seats in the stadium. Jack and Annie set out toward the metro.
The journey proves chaotic. They mistakenly enter a large indoor market instead of the Metro Insurgentes subway station, wasting precious time. Once underground, the crowded trains overwhelm them, and Jack loses Benny's directions. A Mexican boy named Roberto, also heading to the game, hears them asking for help and guides them to the correct transfer. Roberto, who turns ten that day, explains that his parents could only afford one ticket for his birthday present. He has eight brothers and sisters waiting at home for his stories. Roberto leads them through the metro and onto a tram bound for Aztec Stadium, sharing his enthusiasm for Pelé and Brazil's team, nicknamed "the Beautiful Team." The three bond over their shared love of soccer and their mutual admission that none of them are great players.
At the enormous Aztec Stadium, named for the Aztec people who built an empire in the region centuries earlier, an usher reveals that Jack and Annie's tickets are in the second row. Roberto's ticket places him near the very top. Annie insists on trading her ticket with Roberto so he can enjoy a close-up view on his birthday, reasoning that his seat effectively serves eleven people because he will report everything to his family. They compromise: Jack swaps with Roberto for the first half, Annie swaps for the second half, and Roberto sits close to the field the entire game. Annie takes the Ring of Truth to watch for the secret of greatness.
From the top of the stadium, Jack relies on a nearby teenager's commentary and a man's portable radio to follow the distant action. Pelé scores Brazil's first goal, and Italy equalizes to make it 1-1 at halftime. Jack rushes down to find Annie so they can switch seats, but the aisles are jammed and an usher orders him back because his ticket does not match the lower section. Frustrated, Jack returns to the top. Through the radio, he hears Brazil score three more goals in the second half. The final score is Brazil 4, Italy 1, and the stadium erupts.
Jack fights through the celebrating crowds and spots Annie and Roberto on a bench. Annie says the Ring of Truth never glowed during the game. They watch Brazil's captain lift the trophy, then the team leaves, escorted by police. Annie suggests following the team, and Jack recalls hearing about a banquet planned for the players that evening. They chase the team bus across the parking lot, but it pulls away before they can reach it. Jack fears they have failed their mission.
Roberto leads them toward his great-aunt's neighborhood, where a bus can take them back to the city. Along the way, they discover barefoot children playing soccer on a muddy vacant lot. Roberto greets some players, but the kids mock him, recalling that he was the worst player they had ever seen. When a boy asks if Jack and Annie can fill in as forwards, Annie volunteers all three of them, but only if Roberto plays, too. She pulls out the bottle of magic mist. Jack initially protests but agrees that helping their friend matters more than the mission.
Each of them breathes in the mist and wishes to play like Pelé, giving them one hour of magic. Playing with extraordinary skill, they pass, dribble, and score goal after goal. Roberto fires shots into the net, Annie fakes past defenders, and Jack executes a spectacular bicycle kick. Neighborhood spectators leave their porches to watch. An old man shakes their hands, calling them "the Beautiful Team." As the magic hour ends, they sprint away before their abilities fade and collapse, exhausted.
They stop at an outdoor café for food. Roberto remarks that Jack and Annie made him look good through teamwork, then offers a quote from Pelé that his father read in the newspaper: "Enthusiasm is everything." The Ring of Truth erupts with light. Jack and Annie realize enthusiasm is the fourth secret of greatness. Roberto is confused but grateful. He grows sad, saying the magical day will never repeat and he will never be a great player. Jack and Annie share all four secrets with him: humility, hard work, meaning and purpose, and enthusiasm. Roberto resolves to start practicing hard.
Roberto remembers his family is waiting and guides Jack and Annie to a bus. At Metro Insurgentes, he shakes their hands and says goodbye. Jack and Annie walk back through the dark streets, passing Benny at the embassy. Jack tells Benny the game was "the game of a lifetime," thinking not of the World Cup but of their pickup match with Roberto. They climb into the tree house, where Jack writes "ENTHUSIASM" on the list of secrets, and Annie wishes them to Camelot.
The tree house lands in a clearing lit by thousands of lanterns. Morgan le Fay welcomes them, noting they have now traveled 52 times in the magic tree house. Merlin the magician, King Arthur, Queen Guinevere, and other figures from past adventures gather to celebrate, including Teddy, a young sorcerer, and Kathleen, a girl with sea-blue eyes who has aided them on previous missions. They recount highlights of Jack and Annie's adventures. Jack presents the list of four secrets, and Merlin reads them aloud, calling them perfect. Jack and Annie insist they are just regular, lucky kids. Morgan tells Jack he has become kinder and more courageous, and Annie more thoughtful. Merlin warns that future missions may be more challenging, but Morgan reassures them and encourages them to learn, have fun, and read books. The tree house spins them home to Frog Creek at dawn, no time having passed. Energized, they head home, planning to play soccer, invite neighborhood friends, and visit the library.