It was clearly understood in both "The Trouble with Tribbles" and "The Ultimate Computer" that the space stations in question were not full-blown starbases. I would agree that they weren't Spacedock-style cities-in-space, either. OTOH, they aren't Regula One, either.
For these TOS stations to make sense for me, they have to be self-contained vessels, capable of supporting their crews (possibly hundreds, if not a thousand or more guests) indefinitely without re-supply of the essentials. (Trading goods would be another matter.)
For a starbase in deep space, there may actually be more than one structure located in a small area of space. Maybe a K-like space station would be the administrative hub, and nearby would be a few spacedocks, and maybe some other, smaller facilities for weapons or sensor-equipment or whatever. So it could be more like a space "yard".