Add two-stage elicitations for DirectionsTool#99
Open
mattpodwysocki wants to merge 5 commits intomainfrom
Open
Add two-stage elicitations for DirectionsTool#99mattpodwysocki wants to merge 5 commits intomainfrom
mattpodwysocki wants to merge 5 commits intomainfrom
Conversation
Implements MCP server icons at the correct architectural level (server initialization) instead of at the tool level. Adds both light and dark theme variants of the Mapbox logo using base64-encoded SVG data URIs. - Add mapbox-logo-black.svg for light theme backgrounds - Add mapbox-logo-white.svg for dark theme backgrounds - Update server initialization to include icons array with theme property - Use 800x180 SVG logos embedded as base64 data URIs This replaces the previous incorrect approach of adding icons to individual tools, which was not aligned with the MCP specification. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Updates the MCP SDK from 1.25.1 to 1.25.2 and recreates the output validation patch for the new version. The patch continues to convert strict output schema validation errors to warnings, allowing tools to gracefully handle schema mismatches. Changes: - Update @modelcontextprotocol/sdk from ^1.25.1 to ^1.25.2 - Recreate SDK patch for version 1.25.2 - Remove obsolete 1.25.1 patch file - All 397 tests pass with new SDK version Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Implements a two-stage elicitation flow for better route selection: Stage 1 (Routing Preferences): - Elicits user preferences before API call (tolls, highways, ferries) - Maps preferences to exclude parameter - Only triggers for simple A-to-B routes (2 coordinates) - Forces alternatives=true to get multiple routes for Stage 2 Stage 2 (Route Selection): - Presents actual routes with formatted details after API call - Shows duration, distance, traffic levels (✅🟡⚠️ ), and incident counts - User selects preferred route from 2+ alternatives - Returns only the selected route Helper methods: - formatDuration: Convert seconds to "4h 48min" - formatDistance: Convert meters to "366.8km (227.9mi)" Graceful fallback: - Both stages catch errors and continue - Works without elicitation support (returns all routes) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Same fix as PR #100 - allows duration_typical and weight_typical to be null. This fixes the validation error when declining elicitations and getting routes with null duration_typical values from the API.
mattpodwysocki
added a commit
that referenced
this pull request
Jan 15, 2026
…servers Technical deep-dive comparing Mapbox MCP Server against competitors: Key Findings: - Mapbox: 24 tools (most comprehensive) - TomTom: 11 tools - Google Grounding Lite: 3 tools - Google Community: 7 tools Mapbox Unique Strengths: - 9 offline geospatial tools (only server with offline capabilities) - Most sophisticated routing (multi-waypoint, exclusions, constraints) - Only server with map matching for GPS trace cleanup - Only server with travel time matrices - Production-ready monitoring (OpenTelemetry) - MCP protocol leadership (Resources, MCP-UI, Elicitations in progress) Competitor Strengths: - TomTom: Real-time traffic incidents (unique) - Google Grounding: Weather data (unique) - Google Community: Reviews/ratings, elevation data Document includes: - Complete tool inventory for all servers - Feature comparison matrices - Use case fit analysis - Deployment options - Pricing comparison - Roadmap (mentions elicitations in progress - PRs #98, #99) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements a two-stage elicitation flow for DirectionsTool to provide better route selection UX:
Stage 1 (Routing Preferences): Ask users about their routing preferences before calling the API
Stage 2 (Route Selection): Present actual routes for user selection after API call
Implementation Details
formatDuration()andformatDistance()for readable outputalternatives=trueto get multiple routes for Stage 2Test Scenarios
These scenarios demonstrate the two-stage elicitation flow. Screenshots to be added below.
Scenario 1: Full two-stage flow (NYC to Boston)
Input:
{ "coordinates": [ {"longitude": -74.006, "latitude": 40.7128}, {"longitude": -71.0589, "latitude": 42.3601} ], "routing_profile": "mapbox/driving-traffic" }Expected behavior:
exclude=toll,cash_only_tollsScreenshot placeholders:
Scenario 2: User declines Stage 1 preferences
Input:
{ "coordinates": [ {"longitude": -118.24, "latitude": 34.05}, {"longitude": -122.42, "latitude": 37.78} ], "routing_profile": "mapbox/driving" }Expected behavior:
Screenshot placeholders:
Scenario 3: Walking profile (no highway option)
Input:
{ "coordinates": [ {"longitude": -74.006, "latitude": 40.7128}, {"longitude": -73.99, "latitude": 40.73} ], "routing_profile": "mapbox/walking" }Expected behavior:
Screenshot placeholders:
Scenario 4: Multi-waypoint route (no elicitation)
Input:
{ "coordinates": [ {"longitude": -74.006, "latitude": 40.7128}, {"longitude": -73.9, "latitude": 41.0}, {"longitude": -71.0589, "latitude": 42.3601} ] }Expected behavior:
Scenario 5: Exclude parameter already provided (no Stage 1)
Input:
{ "coordinates": [ {"longitude": -74.006, "latitude": 40.7128}, {"longitude": -71.0589, "latitude": 42.3601} ], "exclude": "motorway" }Expected behavior:
Testing
Notes