A mysterious signal consisting of only one intelligible word — "terratin" — draws the Enterprise and her crew to the lone planet of the Cepheus system. While the Enterprise is orbiting the planet, something on the surface emits a flash of energy that temporarily immobilizes the crew and damages the ship's dilithium crystals and various circuits. It soon becomes apparent that all organic matter aboard the ship is rapidly shrinking, including the crew and their organic xenylon uniforms, and according to Spock's calculations everyone aboard will be less than one centimeter tall in less than 32 minutes.
With the transporter set up to return him automatically, Kirk beams down to the crystalline, volcano-covered surface of Cepheus, at the location from which the energy beam originated. Kirk notices that the transporter has restored him to normal size, and also sees a miniaturized alien city, though the automated transporter returns him to the Enterprise before he can examine it thoroughly.
Once back aboard, Kirk discovers that his entire crew has been spirited away to the miniature city on the planet's surface. He contacts the city's inhabitants, threatening them with destruction if they fail to return the people they've seized, only to learn that their "attack" on the Enterprise had actually been a cry for help. The miniature city's leader, the Mendant of the Terratins, explains that their city is about to be destroyed by the planet's constant volcanic activity, and Spock discovers that the tiny "Terratins" are mutated humans descended from a lost team of explorers who had named their adopted world "Terra Ten."
After using the transporter to regain their normal size, the members of Kirk's crew replace the Enterprise's damaged dilithium supply with local crystals, and bring the Terratin city aboard, to relocate it and its inhabitants to a safer planet.