On stardate 4523.3, Captain James T. Kirk and his crew are called to Deep Space Station K7 by a priority-one distress call. The station is near Sherman's Planet, a world in a sector of space disputed between the Federation and the Klingon Empire. Under the terms of the Organian Peace Treaty, Sherman's Planet would be awarded to whichever side demonstrates that it can manage it more efficiently.
Kirk is furious when he later realizes the distress call was unwarranted, and the undersecretary in charge of agriculture in the sector, Nilz Baris, simply wants someone to guard the shipments of quadrotriticale, a four-lobed wheat-rye hybrid grain, bound for Sherman's Planet. To Baris's annoyance, Kirk assigns two token guards to the task shortly before learning that Starfleet Command endorses Baris's concerns. A Klingon ship soon arrives at the space station and requests that its crew be granted shore leave, as entitled under the treaty. Kirk tells the Klingon captain Koloth that he may only bring members of his crew down 12 at a time, and that he will provide one security guard for each Klingon who beams down.
Meanwhile, an independent trader, Cyrano Jones, brings some little furry animals called tribbles onto the station to sell; he gives one to Uhura as a marketing ploy. She brings it on board the Enterprise, where it and its offspring are treated as adorable pets. The animals purr a relaxing trill that the crew (even the stoic Mr. Spock) find soothing. Klingons, however, find tribbles very annoying, and the feeling is mutual: tribbles emit an ear-piercing shriek of aggression, and jump, whenever they are near Klingons. (It has subsequently been explained that tribbles have a keen sense of smell and find food by scent, that they find the smell of Klingons offensive, and that Klingons, who are likewise spoken of as having a keen sense of smell, find the "stench" of tribbles repulsive.)