The coffee grounds should be composted so that the nutrients are available for the tomatoes to uptake. If you spread them around the garden without composting they will still need to break down before the tomatoes can use them and may just attract unwanted critters.