Skip to content

Conversation

@jussi-sa
Copy link
Contributor

@jussi-sa jussi-sa commented Aug 29, 2025

Description

This PR adds support for the Mapbox Tilequery API as a new tool in the MCP devkit server. The tool allows users to query vector and raster data from Mapbox tilesets at specific geographic coordinates.

What's Added

  • New Tool: tilequery_tool - Query vector and raster data from Mapbox tilesets at geographic coordinates
  • Default Tileset: Uses mapbox.mapbox-streets-v8 as the default tileset when none is specified
  • Complete API Support: Implements all Mapbox Tilequery API parameters and options

Features

Required Parameters

  • longitude (-180 to 180)
  • latitude (-90 to 90)

Optional Parameters with Defaults

  • tilesetId (default: mapbox.mapbox-streets-v8)
  • radius (default: 0 meters)
  • limit (default: 5, range: 1-50)
  • dedupe (default: true)

Optional Filters

  • geometry - Filter by geometry type (polygon, linestring, point)
  • layers - Specific layer names to query
  • bands - Specific band names for rasterarray tilesets

Usage Examples

Basic query (uses defaults)

{
  "longitude": -122.4194,
  "latitude": 37.7749
}

Advanced query with custom parameters

  {
    "tilesetId": "mapbox.mapbox-streets-v8",
    "longitude": -122.4194,
    "latitude": 37.7749,
    "radius": 100,
    "limit": 10,
    "geometry": "polygon",
    "layers": ["contour"]
  }

Implementation Details

  • Extends MapboxApiBasedTool for consistent authentication and error handling
  • Comprehensive Zod schema validation with proper TypeScript types
  • Full test coverage with 7 test cases covering all validation scenarios
  • Follows existing codebase patterns and conventions

Testing

  • Added unit tests
  • Manual testing on Claude Desktop:
    • Simple query with just coordinates
image
  • Ran a prompt which tested all the combinations of input parameters
image

Checklist

  • Code has been tested locally
  • Unit tests have been added or updated
  • Documentation has been updated if needed

Additional Notes

@jussi-sa jussi-sa requested a review from a team as a code owner August 29, 2025 10:46
@jussi-sa jussi-sa merged commit b150fe3 into main Aug 29, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants