
Mapbox Search Patterns
Pick the right Mapbox search API and parameters when an agent geocodes addresses, finds POIs, or reverse-geocodes coordinates.
Overview
mapbox-search-patterns is an agent skill most often used in Build (also Validate prototype maps, Operate search tuning) that tells assistants which Mapbox search tool and parameters fit geocoding, POI, and reverse-geocod
Install
npx skills add https://github.com/mapbox/mapbox-agent-skills --skill mapbox-search-patternsWhat is this skill?
- Three-tool matrix: search_and_geocode_tool, category_search_tool, reverse_geocode_tool
- Explicit do-not-use rules (brands vs generic categories vs coordinates)
- Query-shape heuristics for addresses, chains, plurals, and is-a phrases
- POI vs named-place disambiguation for agent tool routing
- Best-practices framing for geocoding, POI search, and location discovery
- 3 Mapbox search tools documented (search_and_geocode, category_search, reverse_geocode)
Adoption & trust: 848 installs on skills.sh; 64 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your agent keeps calling the wrong Mapbox search endpoint—geocoding generic categories or category search for specific brand names—so results are empty or irrelevant.
Who is it for?
Builders shipping location-aware agents or SaaS with Mapbox search tools who want consistent tool-selection rules in SKILL.md.
Skip if: Projects without Mapbox APIs, pure static map tiles with no search, or teams that only need turn-by-turn navigation SDK docs.
When should I use this skill?
User or agent task involves Mapbox geocoding, POI/category search, or converting coordinates to addresses and tool choice is ambiguous.
What do I get? / Deliverables
Queries get routed to search_and_geocode, category_search, or reverse_geocode based on named-place vs category vs coordinate signals, improving discovery accuracy in map-powered features.
- Correct Mapbox tool selection per query type
- Parameter and phrasing guidance embedded in agent behavior
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
First appears in Build when wiring Mapbox tools into apps or agent skills; the same routing rules apply later when debugging search quality in Operate. Integrations subphase is the canonical home for tool-selection guidance that sits between product features and external Mapbox APIs.
Where it fits
Prototype a store locator and teach the agent to use category_search_tool for "pharmacies near downtown" instead of geocoding the phrase as an address.
Wire MCP search tools so brand queries like McDonald's route to search_and_geocode_tool per the skill matrix.
Align UI place-picker prompts with the same rules the backend agent uses for Mapbox parameters.
After user reports bad POI results, refine agent instructions using the don't-use-for lists for each tool.
How it compares
This is search-routing procedural knowledge for agents, not a replacement for Mapbox GL JS rendering or general GIS tutorial content.
Common Questions / FAQ
Who is mapbox-search-patterns for?
Solo builders and agent authors integrating Mapbox geocoding and POI search who need assistants to pick the right tool from query wording.
When should I use mapbox-search-patterns?
At Build when defining agent tools for maps; during Validate when prototyping place search; at Operate when fixing wrong-endpoint behavior in production prompts.
Is mapbox-search-patterns safe to install?
It is documentation-only guidance; review Security Audits on this page and keep Mapbox access tokens out of client-exposed bundles per your own policy.
SKILL.md
READMESKILL.md - Mapbox Search Patterns
# Mapbox Search Patterns Skill 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. ## Available Search Tools ### 1. search_and_geocode_tool **Best for:** Specific places, addresses, brands, named locations **Use when query contains:** - Specific names: "Starbucks on 5th Avenue", "Empire State Building" - Brand names: "McDonald's", "Whole Foods" - Addresses: "123 Main Street, Seattle", "1 Times Square" - Chain stores: "Target" - Cities/places: "San Francisco", "Portland" **Don't use for:** Generic categories ("coffee shops", "museums") ### 2. category_search_tool **Best for:** Generic place types, categories, plural queries **Use when query contains:** - Generic types: "coffee shops", "restaurants", "gas stations" - Plural forms: "museums", "hotels", "parks" - Is-a phrases: "any coffee shop", "all restaurants", "nearby pharmacies" - Industry terms: "electric vehicle chargers", "ATMs" **Don't use for:** Specific names or brands ### 3. reverse_geocode_tool **Best for:** Converting coordinates to addresses, cities, towns, postcodes **Use when:** - Have GPS coordinates, need human-readable address - Need to identify what's at a specific location - Converting user location to address ## Tool Selection Decision Matrix | 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 | ## Parameter Guidance ### Proximity vs Bbox vs Country **Three ways to spatially constrain search results:** #### 1. proximity (STRONGLY RECOMMENDED) **What it does:** Biases results toward a location, but doesn't exclude distant matches **Use when:** - User says "near me", "nearby", "close to" - Have a reference point but want some flexibility - Want results sorted by relevance to a point **Example:** ```json { "q": "pizza", "proximity": { "longitude": -122.4194, "latitude": 37.7749 } } ``` **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. #### 2. bbox (Bounding Box) **What it does:** Hard constraint - ONLY returns results within the box **Use when:** - User specifies an area: "in downtown", "within this neighborhood" - Have a defined service area - Need to guarantee results are within bounds **Example:** ```json { "q": "hotel", "bbox": [-122.51, 37.7, -122.35, 37.83] // [minLon, minLat, maxLon, maxLat] } ``` **Why this works:** Guarantees all hotels are within SF's downtown area **Watch out:** Too small = no results; too large = irrelevant results #### 3. country **What it does:** Limits results to specific countries **Use when:**