mapbox-search-patterns
This skill guides agents in selecting and configuring Mapbox search tools for geocoding, POI lookup, and location discovery.
Identity proven by GitHub's verified organisation badge (mapbox)
- Agents
- Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode, claude.ai and API
- License
- MIT (permissive)
- Pin
- f71cd72pinned Oct 9, 2026
- Context cost
- about 3,100 tokenswhen the skill loads
- GitHub stars
- 80on mapbox/mapbox-agent-skills
- Scripts
- None found
What it does
“Expert guidance on choosing the right Mapbox search tool and parameters for geocoding, POI search, and location discovery”
Generated summary from the skill's own text
This skill guides agents in selecting and configuring Mapbox search tools for geocoding, POI lookup, and location discovery. It covers when to use search_and_geocode_tool for specific addresses and brands, category_search_tool for generic place types, and reverse_geocode_tool for coordinate-to-address conversion, plus parameter strategies for proximity, bounding box, and country filtering.
When to use it
- Building location features requiring tool selection between geocoding, category search, and reverse geocoding
- Implementing local search with spatial constraints like proximity or bounding boxes
- Disambiguating place queries using country codes or feature type filtering
- Designing search interfaces needing appropriate result limits and parameters
When not to
- Routing or navigation features needing turn-by-turn directions
- Real-time traffic or travel time estimates without specific user request
Install
These commands install from the publisher's repository and need no account.
skills CLI
npx skills add mapbox/mapbox-agent-skills --skill mapbox-search-patternsInstalls from the repository's default branch, which may have changed since the commit we checked.
GitHub CLI 2.90 or later
gh skill install mapbox/mapbox-agent-skills mapbox-search-patterns@f71cd72b8d8937b06db440538bd65559eb792c49Installs the commit we checked (f71cd72).
Copy by hand
Download the folder at f71cd72 and put it in .claude/skills/mapbox-search-patterns for Claude Code and in .agents/skills/mapbox-search-patterns for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode.
Claude Code plugin
/plugin install mapbox@claude-plugins-officialThe publisher's plugin in Claude's official marketplace. It may hold more than this skill, and we have not pinned it.
Copy for your agent
A prompt for any coding agent. It installs this skill from GitHub at the pinned commit, copies the files as they are, and runs nothing unless you ask.
Prompt
Install the agent skill "mapbox-search-patterns" by Mapbox. Source, pinned to commit f71cd72b8d8937b06db440538bd65559eb792c49: https://github.com/mapbox/mapbox-agent-skills/tree/f71cd72b8d8937b06db440538bd65559eb792c49/skills/mapbox-search-patterns 1. Download that folder at exactly this commit. Do not use the default branch. 2. Copy every file unchanged, keeping the folder structure, into .claude/skills/mapbox-search-patterns/ for Claude Code and .agents/skills/mapbox-search-patterns/ for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode. Create the folders if they do not exist. 3. Do not edit the files, and do not run any script in the folder unless I ask you to. 4. When you are done, list the files you copied and where you put them. Listing and checks: https://www.agentnative.dev/skills/mapbox/mapbox-search-patterns
SKILL.md at the pin
---
name: mapbox-search-patterns
description: Expert guidance on choosing the right Mapbox search tool and parameters for geocoding, POI search, and location discovery
---
# 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:**
- User specifies country: "restaurants in France"
- Building country-specific features
- Need to respect regional boundaries
- Or it is otherwise clear they want results within a specific country
**Example:**
```json
{
"q": "Paris",
"country": ["FR"] // ISO 3166 alpha-2 codes
}
```
**Why this works:** Finds Paris, France (not Paris, Texas)
**Can combine:** `proximity` + `country` + `bbox` or any combination of the three
### Decision Matrix: Spatial Filters
| 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 |
### Setting limit Parameter
**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
### types Parameter (search_and_geocode_tool)
**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:**
```json
// Only POIs and addresses, no cities
{"q": "Paris", "types": ["poi", "address"]}
// Returns Paris Hotel, Paris Street, not Paris, France
// Only places (cities)
{"q": "Paris", "types": ["place"]}
// Returns Paris, France; Paris, Texas; etc.
```
**Default behavior:** All types included (usually what you want)
### auto_complete Parameter (search_and_geocode_tool)
**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:**
<!-- cspell:disable -->
```json
// User types "starb"
{ "q": "starb", "auto_complete": true }
// Returns: Starbucks, Starboard Tavern, etc.
```
**Use for:**
- Search-as-you-type interfaces
- Handling typos ("mcdonalds" -> McDonald's)
<!-- cspell:enable -->
- Incomplete queries
**Don't use for:**
- Final/submitted queries (less precise)
- When you need exact matches
## Anti-Patterns to Avoid
### Don't: Use category_search for brands
```javascript
// BAD
category_search_tool({ category: 'starbucks' });
// "starbucks" is not a category, returns error
// GOOD
search_and_geocode_tool({ q: 'Starbucks' });
```
### Don't: Use search_and_geocode for generic categories
```javascript
// BAD
search_and_geocode_tool({ q: 'coffee shops' });
// Less precise, may return unrelated results
// GOOD
category_search_tool({ category: 'coffee_shop' });
```
### Don't: Forget proximity for local searches
```javascript
// BAD - Results may be anywhere globally
category_search_tool({ category: 'restaurant' });
// GOOD - Biased to user location
category_search_tool({
category: 'restaurant',
proximity: { longitude: -122.4194, latitude: 37.7749 }
});
```
### Don't: Geocode ambiguous place names without proximity (REST too)
This applies to Mapbox Geocoding API v5 / Search Box in browser apps — not only MCP tools.
```javascript
// BAD — limit=1 without proximity can resolve "Lincoln Memorial" to Illinois
fetch(`https://api.mapbox.com/geocoding/v5/mapbox.places/${encodeURIComponent(q)}.json?access_token=${token}&limit=1`);
// GOOD — bias to map center (and optional bbox)
fetch(
`https://api.mapbox.com/geocoding/v5/mapbox.places/${encodeURIComponent(q)}.json` +
`?access_token=${token}&proximity=-77.0369,38.9072&bbox=-77.15,38.79,-76.90,38.99&limit=1`
);
```
Also debounce search inputs (`clearTimeout` + `setTimeout`) so every keystroke does not fire a geocode.
### Don't: Use bbox when you mean proximity
```javascript
// BAD - Hard boundary may exclude good nearby results
search_and_geocode_tool({
q: 'pizza',
bbox: [-122.42, 37.77, -122.41, 37.78] // Tiny box
});
// GOOD - Bias toward point, but flexible
search_and_geocode_tool({
q: 'pizza',
proximity: { longitude: -122.4194, latitude: 37.7749 }
});
```
### Don't: Request ETA unnecessarily
```javascript
// BAD - Costs API quota for routing calculations
search_and_geocode_tool({
q: 'museums',
eta_type: 'navigation',
navigation_profile: 'driving'
});
// User didn't ask for travel time!
// GOOD - Only add ETA when needed
search_and_geocode_tool({ q: 'museums' });
// If user asks "how long to get there?", then add ETA
```
### Don't: Set limit too high for UI display
```javascript
// BAD - Overwhelming for simple dropdown
category_search_tool({
category: 'restaurant',
limit: 25
});
// Returns 25 restaurants for a 5-item dropdown
// GOOD - Match UI needs
category_search_tool({
category: 'restaurant',
limit: 5
});
```
## Quick Reference
### Tool Selection Flowchart
```
User query contains...
-> Specific name/brand (Starbucks, Empire State Building)
-> search_and_geocode_tool
-> Generic category/plural (coffee shops, museums, any restaurant)
-> category_search_tool
-> Coordinates -> Address
-> reverse_geocode_tool
-> Address -> Coordinates
-> search_and_geocode_tool with types: ["address"]
```
### Essential Parameters Checklist
**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)
## Common Mistakes
1. **Forgetting proximity** -> Results are global/IP-based (or wrong state for ambiguous memorial/park names)
2. **Using wrong tool** -> category_search for "Starbucks" (use search_and_geocode)
3. **Invalid category** -> Check category_list first
4. **Bbox too small** -> No results; use proximity instead
5. **Requesting ETA unnecessarily** -> Adds API cost
6. **Limit too high for UI** -> Overwhelming user
7. **Not filtering types** -> Get cities when you want POIs
8. **No debounce on typeahead** -> Quota burn and racy UI
## Reference Files
Load these for deeper guidance on specific topics:
- **`references/advanced-params.md`** — poi_category, ETA, format, and language parameters
- **`references/workflows.md`** — Common patterns: Near Me, Branded, Geocoding, Category+Area, Reverse, Route-Based, Multilingual
- **`references/optimization-combining.md`** — Performance optimization, combining tools, handling no results, category list resource
From mapbox/mapbox-agent-skills at f71cd72, shown as plain text under its license: MIT (permissive). The license text is in LICENSE.md.
View SKILL.md on GitHub at f71cd72Files
- SKILL.md13 KB · f45ae90a7f5c
- evals/
- evals.json1.6 KB · a5e2c2e16303
- references/
- advanced-params.md2.9 KB · dbf96b9f5cb9
- optimization-combining.md4.4 KB · d956a96d9448
- workflows.md2.6 KB · 92ede74d0301
5 files, 24 KB in total. Each file has a sha256 in the pin's manifest; the first 12 characters are shown.
Skill folder on GitHub at f71cd72More from Mapbox
mapbox-android-patterns
This skill provides official patterns for integrating Mapbox Maps SDK v11 on Android, covering setup, map initialization, markers, user location display…
Claude Code, Codex, Cursor +4 · about 2.5K tokens · pinned 6 days ago
mapbox-cartography
This skill provides cartographic expertise for designing effective maps with Mapbox, covering visual hierarchy, color theory, typography, and zoom strategies.
Claude Code, Codex, Cursor +4 · about 1.7K tokens · pinned 6 days ago
mapbox-data-visualization-patterns
This skill teaches the agent to implement data visualization patterns on Mapbox maps, including choropleth maps, heat maps, 3D extrusions, and animated data…
Claude Code, Codex, Cursor +4 · about 2.1K tokens · pinned 6 days ago
mapbox-flutter-patterns
This skill teaches agents the standard patterns for integrating the Mapbox Maps Flutter SDK into iOS and Android apps written in Dart.
Claude Code, Codex, Cursor +4 · about 2.3K tokens · pinned 6 days ago
mapbox-geospatial-operations
This skill guides agents on selecting appropriate geospatial tools from the Mapbox MCP Server based on problem requirements.
Claude Code, Codex, Cursor +4 · about 4.8K tokens · pinned 6 days ago
mapbox-google-maps-migration
This skill guides developers migrating from Google Maps Platform to Mapbox GL JS by comparing APIs, translating patterns, and highlighting architectural…
Claude Code, Codex, Cursor +4 · about 2.9K tokens · pinned 6 days ago
Related in AI and agents
agent-builder
Agent Builder orchestrates the creation, modification, testing, and publishing of n8n Agents.
by n8nOfficial publisher
Claude Code, Codex, Cursor +3 · about 2.3K tokens · pinned 6 days ago
intent-recognition
Classifies automation requests by determining which primitive owns the top-level control flow (workflow, agent, needs clarification, or out-of-scope) and…
by n8nOfficial publisher
Claude Code, Codex, Cursor +4 · about 6.9K tokens · pinned 6 days ago
planned-task-runtime
This skill manages follow-up interactions with a background task execution system, handling task completion synthesis, failure replanning, workflow building…
by n8nOfficial publisher
Claude Code, Codex, Cursor +3 · about 2.2K tokens · pinned 6 days ago
skill-creator
This skill guides agents through creating new skills that extend Gemini CLI with specialized knowledge, workflows, and tool integrations.
by GoogleOfficial publisher
Contains scripts
Gemini CLI · about 5K tokens · pinned 6 days ago
-21risk-automation
This skill automates 21risk operations by connecting to the 21risk toolkit through Composio's Rube MCP server.
by ComposioOfficial publisher
Claude Code, Codex, Cursor +3 · about 690 tokens · pinned 6 days ago
-2chat-automation
This skill automates 2chat tasks by integrating with Composio's 2chat toolkit through Rube MCP.
by ComposioOfficial publisher
Agents not labelled yet · about 680 tokens · pinned 6 days ago