From c2e16f28424af87520541c0904c0667aaa6fa4ed Mon Sep 17 00:00:00 2001 From: asem89 Date: Tue, 23 Jun 2026 23:50:37 +0200 Subject: [PATCH] fix(places): OR-match multi-value categories in find_nearby_places find_nearby_places called WithTag(key, value) once per value, producing AND-matched filters like [amenity=restaurant][amenity=cafe][amenity=bar]... A single element can never hold all those values at once, so every multi-value category (restaurant, cafe, healthcare, finance, transport, ...) returned an empty {"places":[]} result regardless of location. Pass all values in one WithTag(key, values...) call so the builder emits the intended OR-regex [amenity~"restaurant|cafe|..."], matching the usage example documented in pkg/core/overpass.go. --- pkg/tools/places.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkg/tools/places.go b/pkg/tools/places.go index 4696911..094d21f 100644 --- a/pkg/tools/places.go +++ b/pkg/tools/places.go @@ -77,12 +77,13 @@ func HandleFindNearbyPlaces(ctx context.Context, req mcp.CallToolRequest) (*mcp. WithTimeout(25). WithCenter(lat, lon, radius) - // Add tag filters if category specified + // Add tag filters if category specified. + // Pass all values for a key in ONE WithTag call so the builder emits an OR-regex + // ([amenity~"restaurant|cafe|..."]). Calling WithTag once per value instead emits + // [amenity=restaurant][amenity=cafe]... which AND-matches and always returns empty. if len(osmTags) > 0 { for key, values := range osmTags { - for _, value := range values { - queryBuilder.WithTag(key, value) - } + queryBuilder.WithTag(key, values...) } }