Conversation
Add explore_mapbox_api_tool to provide structured, queryable information about Mapbox API endpoints, operations, parameters, and authentication. Features: - List all available Mapbox APIs (7 APIs with 24 operations total) - View operations for specific APIs - Get detailed endpoint information with parameters, scopes, rate limits - Optional detailed mode includes example requests/responses - Proper MCP structured content support with separate text and data Coverage: - Geocoding API (forward/reverse geocoding) - Styles API (CRUD operations) - Tokens API (token management) - Static Images API (map image generation) - Directions API (route calculation) - Tilequery API (vector tile queries) - Feedback API (user feedback events) Implementation: - Created mapboxApiEndpoints.ts with curated API definitions - Implemented BaseTool with input/output schemas - Returns both markdown content and structured data - 21 comprehensive test cases, all passing - Updated tool registry and documentation Complements get_latest_mapbox_docs_tool by providing structured API reference data instead of prose documentation. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add validate_api_request_tool to validate Mapbox API requests against endpoint definitions before sending them to the API. Features: - Validates required parameters are present - Checks parameter types (string, number, boolean, array, object) - Validates enum constraints for parameters with allowed values - Verifies token has required scopes for operations - Detects extra/unknown parameters with warnings - Returns detailed validation results with specific error messages - Helps prevent failed API calls by catching issues early Validation coverage: - Path, query, and body parameters - Type checking with clear error messages - Enum validation (e.g., routing profiles, geocoding modes) - Token scope verification - Case-insensitive API and operation names Implementation: - Uses endpoint definitions from mapboxApiEndpoints.ts (from PR #75) - Implements comprehensive validation logic - 19 test cases covering all validation scenarios - Proper MCP structured content with separated text and data - Updated tool registry and documentation This tool builds on top of explore_mapbox_api_tool by using the same endpoint definitions to provide validation capabilities. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
| @@ -0,0 +1,1278 @@ | |||
| /** | |||
| * Mapbox API endpoint definitions for the explore_mapbox_api_tool. | |||
There was a problem hiding this comment.
What is the plan to scale this and/or keep it up to date? Might it be worth talking to the docs team about keeping generated Open API specs( or an equivalent) in https://github.com/mapbox/help as the source of truth, then consume them downstream here to prevent manual updates from being necessary?
|
Great question about scalability! This is definitely something we should address. Current Approach (MVP)This PR uses a manually curated list as an MVP to:
Scaling StrategyYou're absolutely right that manual maintenance doesn't scale. Here's the path forward: Short-term (This PR)
Medium-term (Follow-up)Option 1: OpenAPI Spec Generation ✨
Option 2: Fetch from Documentation
Long-term
Action Items
Questions for Discussion
Would love to sync with the docs team on this! The manual approach gets us started, but automated spec generation is definitely the right long-term solution. What do you think about this phased approach? |
Summary
Implements
explore_mapbox_api_toolto provide structured, queryable information about Mapbox API endpoints, operations, parameters, and authentication requirements. Resolves #71.Features
details: true)API Coverage
Documented 7 APIs with 24 total operations:
Implementation Details
/src/constants/mapboxApiEndpoints.tswith curated API definitionsBaseToolwith proper input/output schemasTesting
Documentation
get_latest_mapbox_docs_toolby providing structured API reference dataScreenshots
Successfully tested in both MCP Inspector (structured content validation) and Claude Desktop (natural language queries).
🤖 Generated with Claude Code