npx skills add ...
npx skills add mapbox/mapbox-agent-skills --skill mapbox-search-patterns
Expert guidance on choosing the right Mapbox search tool and parameters for geocoding, POI search, and location discovery
npx skills add mapbox/mapbox-agent-skills --skill mapbox-search-patterns
Expert guidance for AI assistants on using Mapbox search tools effectively. Covers tool selection, parameter optimization, and best practices for geocoding, POI search, and location discovery.
Best for: Specific places, addresses, brands, named locations
Use when query contains:
Don't use for: Generic categories ("coffee shops", "museums")
Best for: Generic place types, categories, plural queries
Use when query contains:
Don't use for: Specific names or brands
Best for: Converting coordinates to addresses, cities, towns, postcodes
Use when:
| User Query | Tool | Reasoning |
|---|---|---|
| "Find Starbucks on Main Street" | search_and_geocode_tool | Specific brand name |
| "Find coffee shops nearby" | category_search_tool | Generic category, plural |
| "What's at 37.7749, -122.4194?" | reverse_geocode_tool | Coordinates to address |
| "Empire State Building" | search_and_geocode_tool | Specific named POI |
| "hotels in downtown Seattle" | category_search_tool | Generic type + location |
| "Target store locations" | search_and_geocode_tool | Brand name (even plural) |
| "any restaurant near me" | category_search_tool | Generic + "any" phrase |
| "123 Main St, Boston, MA" | search_and_geocode_tool | Specific address |
| "electric vehicle chargers" | category_search_tool | Industry category |
| "McDonald's" | search_and_geocode_tool | Brand name |
Three ways to spatially constrain search results:
What it does: Biases results toward a location, but doesn't exclude distant matches
Use when:
Example:
Why this works: API returns SF pizza places first, but might include famous NYC pizzerias if highly relevant
Critical: Always set proximity when you have a reference location! Without it, results are IP-based or global.
What it does: Hard constraint - ONLY returns results within the box
Use when:
Example:
Why this works: Guarantees all hotels are within SF's downtown area
Watch out: Too small = no results; too large = irrelevant results
What it does: Limits results to specific countries
Use when:
Example:
Why this works: Finds Paris, France (not Paris, Texas)
Can combine: proximity + country + bbox or any combination of the three
| Scenario | Use | Why |
|---|---|---|
| "Find coffee near me" | proximity | Bias toward user location |
| "Coffee shops in downtown Seattle" | proximity + bbox | Center on downtown, limit to area |
| "Hotels in France" | country | Hard country boundary |
| "Best pizza in San Francisco" | proximity + country ["US"] | Bias to SF, limit to US |
| "Gas stations along this route" | bbox around route | Hard constraint to route corridor |
| "Restaurants within 5 miles" | proximity (then filter by distance) | Bias nearby, filter results |
category_search_tool only (1-25, default 10)
| Use Case | Limit | Reasoning |
|---|---|---|
| Quick suggestions | 5 | Fast, focused results |
| Standard list | 10 | Default, good balance |
| Comprehensive search | 25 | Maximum allowed |
| Map visualization | 25 | Show all nearby options |
| Dropdown/autocomplete | 5 | Don't overwhelm UI |
Performance tip: Lower limits = faster responses
Filter by feature type:
| Type | What It Includes | Use When |
|---|---|---|
poi | Points of interest (businesses, landmarks) | Looking for POIs, not addresses |
address | Street addresses | Need specific address |
place | Cities, neighborhoods, regions | Looking for area/region |
street | Street names without numbers | Need street, not specific address |
postcode | Postal codes | Searching by ZIP/postal code |
district | Districts, neighborhoods | Area-based search |
locality | Towns, villages | Municipality search |
country | Country names | Country-level search |
Example combinations:
Default behavior: All types included (usually what you want)
What it does: Enables partial/fuzzy matching
| Setting | Behavior | Use When |
|---|---|---|
true | Matches partial words, typos | User typing in real-time |
false (default) | Exact matching | Final query, not autocomplete |
Example:
Use for:
Don't use for:
This applies to Mapbox Geocoding API v5 / Search Box in browser apps — not only MCP tools.
Also debounce search inputs (clearTimeout + setTimeout) so every keystroke does not fire a geocode.
For local searches, ALWAYS set:
proximity (or bbox if strict boundary needed)For category searches, consider:
limit (match UI needs)format (json_string if plotting on map)For disambiguation, use:
country (when geographic context matters)types (when feature type matters)For travel-time ranking:
eta_type, navigation_profile, origin (costs API quota)Load these for deeper guidance on specific topics:
references/advanced-params.md — poi_category, ETA, format, and language parametersreferences/workflows.md — Common patterns: Near Me, Branded, Geocoding, Category+Area, Reverse, Route-Based, Multilingualreferences/optimization-combining.md — Performance optimization, combining tools, handling no results, category list resource