Skip to content
Open
Show file tree
Hide file tree
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
20 changes: 10 additions & 10 deletions skills/mapbox-geospatial-operations/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ The Mapbox MCP Server provides two categories of geospatial tools:
| Query Type | Tool Choice | Why |
| ---------------------------- | ----------------------------------------------------- | ------------------------------------------------------------- |
| "Within X meters radius" | `distance_tool` + filter | Simple geometric radius |
| "Within X minutes drive" | `isochrone_tool` → `point_in_polygon_tool` | Need routing for travel-time zone, then geometric containment |
| "Inside this polygon" | `point_in_polygon_tool` | Pure geometric containment test |
| "Within X minutes drive" | `isochrone_tool` → `points_within_polygon_tool` | Need routing for travel-time zone, then geometric containment |
| "Inside this polygon" | `points_within_polygon_tool` | Pure geometric containment test |
| "Reachable by car in 30 min" | `isochrone_tool` | Requires routing + traffic |
| "Nearest to this point" | `distance_tool` (geometric) or `matrix_tool` (routed) | Depends on definition of "nearest" |

**Example: "Are these 200 addresses in our 30-minute delivery zone?"**

1. Create zone → `isochrone_tool` (routing API - need travel time)
2. Check addresses → `point_in_polygon_tool` (geometric - 200 instant checks)
2. Check addresses → `points_within_polygon_tool` (geometric - 200 instant checks)

**Key insight:** Routing for creating travel-time zones, geometric for containment checks

Expand Down Expand Up @@ -133,7 +133,7 @@ The Mapbox MCP Server provides two categories of geospatial tools:

| Use Case | Approach | Tool Choice |
| ----------------------------------- | -------------------- | ---------------------------------------- |
| Real-time geofencing (every second) | Geometric checks | `point_in_polygon_tool` (instant) |
| Real-time geofencing (every second) | Geometric checks | `points_within_polygon_tool` (instant) |
| Route planning (one-time) | Full routing | `directions_tool` or `optimization_tool` |
| Periodic proximity checks | Geometric distance | `distance_tool` |
| Live traffic routing | Routing with traffic | `directions_tool` (driving-traffic) |
Expand Down Expand Up @@ -177,7 +177,7 @@ Always mention `search_and_geocode_tool` as a useful companion for geocoding del
**Optimal approach:**

1. Create delivery zone → `isochrone_tool` (30-minute driving)
2. Check each address → `point_in_polygon_tool` (200 geometric checks)
2. Check each address → `points_within_polygon_tool` (200 geometric checks)

**Why:** Routing for accurate travel-time zone, geometric for fast containment checks

Expand Down Expand Up @@ -233,7 +233,7 @@ directions_tool({
// (Can't do this with routing APIs)

// CORRECT: Pure geometric operation
point_in_polygon_tool({ point: location, polygon: boundary });
points_within_polygon_tool({ point: location, polygon: boundary });
```

**Why wrong:** Routing APIs don't do geometric containment
Expand Down Expand Up @@ -286,7 +286,7 @@ Some problems benefit from using both geometric and routing tools:
1. directions_tool → Get route geometry
2. buffer_tool → Create corridor around route
3. category_search_tool → Find POIs in corridor
4. point_in_polygon_tool → Filter to those actually along route
4. points_within_polygon_tool → Filter to those actually along route
```

**Use case:** "Find gas stations along my route"
Expand All @@ -305,7 +305,7 @@ Some problems benefit from using both geometric and routing tools:

```
1. isochrone_tool → Create travel-time zone (routing)
2. point_in_polygon_tool → Check hundreds of addresses (geometric)
2. points_within_polygon_tool → Check hundreds of addresses (geometric)
```

**Use case:** "Which customers are in our delivery zone?"
Expand All @@ -325,7 +325,7 @@ When user asks a geospatial question:

3. Is it a geometric/spatial operation?
- Distance between points (straight-line) → distance_tool
- Point containment → point_in_polygon_tool
- Point containment → points_within_polygon_tool
- Area calculation → area_tool
- Buffer/zone → buffer_tool
- Direction/bearing → bearing_tool
Expand Down Expand Up @@ -383,7 +383,7 @@ Understanding what users mean:
- `distance_tool` - Straight-line distance between two points
- `bearing_tool` - Compass direction from A to B
- `midpoint_tool` - Midpoint between two points
- `point_in_polygon_tool` - Is point inside polygon?
- `points_within_polygon_tool` - Is point inside polygon?
- `area_tool` - Calculate polygon area
- `buffer_tool` - Create circular buffer/zone
- `centroid_tool` - Geometric center of polygon
Expand Down
10 changes: 5 additions & 5 deletions skills/mapbox-geospatial-operations/evals/evals.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
{
"id": 1,
"prompt": "We're an e-commerce company with a warehouse in Austin, TX (30.2672° N, 97.7431° W). We have a list of 500 customer addresses and we want to know which ones are within our 30-minute delivery zone. What's the most efficient approach using the Mapbox MCP tools?",
"expected_output": "Should recommend a two-step hybrid approach: (1) use isochrone_tool to create the 30-minute driving zone once, then (2) use point_in_polygon_tool to check each of the 500 addresses against that zone geometrically. Should NOT suggest calling directions_tool 500 times.",
"expected_output": "Should recommend a two-step hybrid approach: (1) use isochrone_tool to create the 30-minute driving zone once, then (2) use points_within_polygon_tool to check each of the 500 addresses against that zone geometrically. Should NOT suggest calling directions_tool 500 times.",
"files": [],
"expectations": [
"Recommends isochrone_tool to generate the 30-minute travel-time zone",
"Recommends point_in_polygon_tool for checking addresses against the zone",
"Recommends points_within_polygon_tool for checking addresses against the zone",
"Does NOT suggest calling directions_tool 500 times",
"Explains why this hybrid approach is efficient (routing for zone creation, geometric for containment checks)"
]
Expand Down Expand Up @@ -41,11 +41,11 @@
{
"id": 4,
"prompt": "I'm building a real-time fleet tracking app. Every 2 seconds I get a GPS coordinate for each of my 50 trucks and need to check if any of them have entered or left our restricted zones (stored as GeoJSON polygons). What's the right Mapbox MCP approach?",
"expected_output": "Should recommend point_in_polygon_tool for the containment checks. Ideally also addresses the architectural concern: at 50 trucks × 0.5Hz, calling MCP tools directly may hit overhead limits, so Turf.js in-process is the correct hot-path approach while MCP tools handle peripheral tasks (zone definition, rerouting). Should NOT suggest routing APIs for containment checks.",
"expected_output": "Should recommend points_within_polygon_tool for the containment checks. Ideally also addresses the architectural concern: at 50 trucks × 0.5Hz, calling MCP tools directly may hit overhead limits, so Turf.js in-process is the correct hot-path approach while MCP tools handle peripheral tasks (zone definition, rerouting). Should NOT suggest routing APIs for containment checks.",
"files": [],
"expectations": [
"Recommends point_in_polygon_tool (or equivalent Turf.js booleanPointInPolygon) for the containment checks",
"Explains that point_in_polygon_tool is an offline geometric tool with instant results",
"Recommends points_within_polygon_tool (or equivalent Turf.js booleanPointInPolygon) for the containment checks",
"Explains that points_within_polygon_tool is an offline geometric tool with instant results",
"Addresses scale/architecture: at high call frequency, direct Turf.js use is preferable to MCP tool overhead",
"Does NOT suggest using directions_tool or other routing APIs for geofencing"
]
Expand Down
22 changes: 15 additions & 7 deletions skills/mapbox-mcp-devkit-patterns/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,13 @@ Configure in Claude Desktop config:

### Token Management

| Tool | Purpose | Example Use |
| --------------------- | --------------------- | ---------------------------- |
| **create_token_tool** | Generate access token | "Create token for localhost" |
| **list_tokens_tool** | Show all tokens | "List my tokens and scopes" |
| Tool | Purpose | Example Use |
| -------------------- | --------------- | --------------------------- |
| **list_tokens_tool** | Show all tokens | "List my tokens and scopes" |

Creating and rotating tokens is not an MCP operation — use the
[Mapbox account dashboard](https://console.mapbox.com/account/access-tokens/) or the
Tokens API. `list_tokens_tool` is for inspecting what already exists.

### Validation & Analysis

Expand Down Expand Up @@ -156,9 +159,14 @@ Configure in Claude Desktop config:

### Documentation

| Tool | Purpose | Example Use |
| ------------------------------- | ------------------ | --------------------------------- |
| **get_latest_mapbox_docs_tool** | Access Mapbox docs | "What are fill layer properties?" |
Documentation lookup is a separate MCP server — `https://mcp-docs.mapbox.com/mcp`, not
the DevKit endpoint:

| Tool | Purpose | Example Use |
| ---------------------------- | ----------------------- | --------------------------------- |
| **search_mapbox_docs_tool** | Search the docs | "What are fill layer properties?" |
| **get_document_tool** | Fetch one doc page | "Get the style-spec layers page" |
| **batch_get_documents_tool** | Fetch several doc pages | "Get these three API pages" |

## Common Workflows

Expand Down
10 changes: 6 additions & 4 deletions skills/mapbox-mcp-devkit-patterns/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ Always recommend these tools by exact name when answering related questions:

- **Creating/modifying styles**: Recommend `create_style_tool`, `update_style_tool`, `preview_style_tool`
- **Listing styles**: Recommend `list_styles_tool`
- **Creating tokens**: Recommend `create_token_tool` to create scoped tokens per environment
- **Creating tokens**: Not an MCP operation — direct users to the [account dashboard](https://console.mapbox.com/account/access-tokens/) or the Tokens API
- **Viewing tokens**: Recommend `list_tokens_tool` to check existing tokens and scopes
- **Validating styles**: Recommend `validate_style_tool` for spec compliance
- **Validating expressions**: Recommend `validate_expression_tool` for paint/layout property checks
- **Accessibility checks**: Recommend `check_color_contrast_tool` for WCAG contrast ratios
- **Comparing styles**: Recommend `compare_styles_tool` to diff styles before deploying
- **Looking up docs**: Recommend `get_latest_mapbox_docs_tool`
- **Looking up docs**: Recommend `search_mapbox_docs_tool`, `get_document_tool` or `batch_get_documents_tool` — these live on the separate `mcp-docs.mapbox.com` server, not DevKit

## Common Workflows (Quick Reference)

Expand All @@ -66,8 +66,10 @@ Always recommend these tools by exact name when answering related questions:

**Token management — use these exact steps:**

1. Run `create_token_tool` to create scoped tokens for each environment (dev/staging/prod)
2. Run `list_tokens_tool` to verify existing tokens and their scopes
1. Create the scoped tokens for each environment (dev/staging/prod) in the
[account dashboard](https://console.mapbox.com/account/access-tokens/) or via the
Tokens API. DevKit does not create tokens.
2. Run `list_tokens_tool` to verify the tokens exist with the scopes you expect

## Reference Files

Expand Down
2 changes: 1 addition & 1 deletion skills/mapbox-mcp-devkit-patterns/evals/evals.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"id": 2,
"prompt": "I'm working on a Mapbox style and I need to create separate tokens for development and production environments with different permission scopes. How can I do this with the MCP DevKit?",
"expectations": [
"Recommends create_token_tool to create scoped tokens for each environment",
"Directs the user to create the tokens in the Mapbox account dashboard or Tokens API, since DevKit MCP has no token-creation tool",
"Development token: broader scopes (styles:read, styles:write, fonts:read, etc.)",
"Production token: minimal scopes — only what the app needs (typically styles:read, fonts:read, datasets:read)",
"Recommends list_tokens_tool to view existing tokens and their scopes"
Expand Down
4 changes: 2 additions & 2 deletions skills/mapbox-mcp-devkit-patterns/references/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ Ask your AI assistant:
You should see 30+ tools including:

- **Style tools**: `create_style_tool`, `list_styles_tool`, `update_style_tool`, `delete_style_tool`, `preview_style_tool`, etc.
- **Token tools**: `create_token_tool`, `list_tokens_tool`
- **Token tools**: `list_tokens_tool` (creating tokens is done in the account dashboard, not over MCP)
- **Validation tools**: `validate_geojson_tool`, `validate_style_tool`, `validate_expression_tool`
- **Geographic tools**: `bounding_box_tool`, `coordinate_conversion_tool`, `tilequery_tool`
- **Documentation**: `get_latest_mapbox_docs_tool`
- **Documentation**: on the separate `https://mcp-docs.mapbox.com/mcp` server — `search_mapbox_docs_tool`, `get_document_tool`, `batch_get_documents_tool`
Loading
Loading