You’re supposed to roll for the number of minor, medium, and major items based on town size, usually with multiple d4s. Have you ever looked at the random tables for magic items in a D&D settlement? They aren’t the sort of thing you can use at the table when the PCs unexpectedly visit a town.