Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions pkg/tools/places.go
Original file line number Diff line number Diff line change
Expand Up @@ -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...)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge OR categories across tag keys as well

When the requested category maps to more than one OSM key, this still appends every key to the same global tag set, and OverpassBuilder.buildElementFilter concatenates those filters into one selector (pkg/core/overpass.go:218-220). For example category:"cafe" now emits filters like [amenity~"cafe|ice_cream"][shop~"coffee|tea"], requiring an element to have both tags, while mapCategoryToOSMTags defines those keys as alternatives (pkg/tools/places.go:258-262); the same applies to park, pharmacy, transport, and unknown multi-word categories, so those searches remain empty or severely underreported unless an object happens to carry all tag families.

Useful? React with 👍 / 👎.

}
}

Expand Down