The Glass Bead Game takes place at an unspecified date centuries into the future. Hesse suggested that he imagined the book's narrator writing around the start of the 25th century. The setting is a fictional province of central Europe called Castalia, which was reserved by political decision for the life of the mind; technology and economic life are kept to a strict minimum. Castalia is home to an austere order of intellectuals with a twofold mission: to run boarding schools for boys, and to cultivate and play the Glass Bead Game, whose exact nature remains elusive and whose devotees occupy a special school within Castalia known as Waldzell. The rules of the game are only alluded to—they are so sophisticated that they are not easy to imagine. Playing the game well requires years of hard study of music, mathematics, and cultural history. The game is essentially an abstract synthesis of all arts and sciences. It proceeds by players making deep connections between seemingly unrelated topics.
The novel is an example of a bildungsroman, following the life of a distinguished member of the Castalian Order, Joseph Knecht, whose surname means "servant" (and is cognate with the English word knight ). The plot chronicles Knecht's education as a youth, his decision to join the order, his mastery of the Game, and his advancement in the order's hierarchy to eventually become Magister Ludi , the executive officer of the Castalian Order's game administrators. The beginning of the novel introduces the Music Master, the resident of Castalia who recruits Knecht as a young student and who is to have the most long-lasting and profound effect on Knecht throughout his life. At one point, as the Music Master nears death in his home at Monteport, Knecht obliquely refers to the Master's "sainthood". As a student, another meaningful friendship develops with Plinio Designori, a student from a politically influential family, who is studying in Castalia as a guest. Knecht develops many of his personal views about what larger good Castalia can achieve through vigorous debates with Designori, who views Castalia as an "ivory tower" with little to no impact on the outside world.
Although educated within Castalia, Knecht's path to "Magister Ludi" is atypical for the order, as he spends a significant portion of his time after graduation outside the boundaries of the province. His first such venture, to the Bamboo Grove, results in his learning Chinese and becoming something of a disciple to Elder Brother, a recluse who had given up living within Castalia. Next, as part of an assignment to foster goodwill between the order and the Catholic Church, Knecht is sent on several "missions" to the Benedictine monastery of Mariafels, where he befriends the historian Father Jacobus– a relationship which also has profound personal impact for Knecht.
As the novel progresses, Knecht begins to question his loyalty to the order; he gradually comes to doubt that the intellectually gifted have a right to withdraw from life's big problems. Knecht, too, comes to see Castalia as a kind of ivory tower, an ethereal and protected community, devoted to pure intellectual pursuits but oblivious to the problems posed by life outside its borders. This conclusion precipitates a personal crisis, and, according to his personal views regarding spiritual awakening, Knecht does the unthinkable: he resigns as Magister Ludi and asks to leave the order, ostensibly to become of value and service to the larger culture. The heads of the order deny his request to leave, but Knecht departs Castalia anyway, initially taking a job as a tutor to his childhood friend Designori's energetic and strong-willed son, Tito. Only a few days later, the story ends abruptly with Knecht drowning in a mountain lake while attempting to follow Tito on a swim for which Knecht was unfit.
The fictional narrator leaves off before the final sections of the book, remarking that the end of the story is beyond the scope of his biography. The concluding chapter, entitled "The Legend", is reportedly from a different biography. After this final chapter, several of Knecht's "posthumous" works are then presented. The first section contains Knecht's poetry from various periods of his life, followed by three short stories labeled "Three Lives". The stories are presented as exercises by Knecht imagining his life had he been born in another time and place. The first story tells of a pagan rainmaker named Knecht who lived "many thousands of years ago, when women ruled". Eventually the shaman's powers to summon rain fail, and he offers himself as a sacrifice for the good of the tribe. The second story is based on the life of St Hilarion and tells of Josephus, an early Christian hermit who acquires a reputation for piety but is inwardly troubled by self-loathing and seeks a confessor, only to find that same penitent had been seeking him.
The final story concerns the life of Dasa, a prince wrongfully usurped by his half brother as heir to a kingdom and disguised as a cowherd to save his life. While working with the herdsmen as a young boy, Dasa encounters a yogi in meditation in the forest. He wishes to experience the same tranquility as the yogi, but is unable to stay. He later leaves the herdsmen and marries a beautiful young woman, only to be cuckolded by his half brother (now the Rajah). In a cold fury, he kills his half brother and finds himself once again in the forest with the old yogi, who, through an experience of an alternate life, guides him on the spiritual path and out of the world of illusion (Maya).
The three lives, together with that as Magister Ludi, oscillate between extroversion (rainmaker, Indian life– both get married) and introversion (father confessor, Magister Ludi) while developing the four basic psychic functions of analytical psychology: sensation (rainmaker), intuition (Indian life), feeling (father confessor), and thinking (Magister Ludi).
Originally, Hesse intended several different lives of the same person as he is reincarnated. Instead, he focused on a story set in the future and placed the three shorter stories, "authored" by Knecht in The Glass Bead Game , at the end of the novel.
Two drafts of a fourth life were published in 1965. the second version being recast in the first person and breaking off earlier. Dated 1934, they describe Knecht's childhood and education as a Swabian theologian. This Knecht has been born some dozen years after the Treaty of Rijswijk in the time of Eberhard Ludwig, and in depicting the other characters Hesse draws heavily on actual biographies: Friedrich Christoph Oetinger. Johann Friedrich Rock, Johann Albrecht Bengel and Nicolaus Zinzendorf make up the cast of Pietist mentors. Knecht is heavily drawn to music however, both that of the acknowledged master Pachelbel and the more exotic Buxtehude. The fragment breaks off as the young contemporary of Bach happens upon an organ recital in Stuttgart.