Skip to content

Conversation

@mattpodwysocki
Copy link
Contributor

Summary

Implements two Mapbox Navigation API tools for advanced routing and GPS processing:

1. Map Matching Tool (map_matching_tool)

  • Purpose: Snaps noisy GPS traces to actual road networks
  • Use cases: Fleet tracking cleanup, recorded trip analysis, fitness activity processing
  • Features:
    • Supports 2-100 coordinates with {longitude, latitude} format
    • Optional timestamps and radiuses for improved accuracy
    • Multiple routing profiles: driving, driving-traffic, walking, cycling
    • Returns confidence scores, matched geometry, and optional annotations

2. Optimization Tool (optimization_tool) - V1 API

  • Purpose: Solves Traveling Salesman Problem for optimal route order
  • Use cases: Delivery route optimization, simple multi-stop routing
  • API: Uses V1 synchronous GET endpoint (/optimized-trips/v1)
  • Features:
    • Supports 2-12 coordinates
    • Synchronous (no polling needed)
    • Options for source, destination, roundtrip
    • Returns optimized waypoint order with distance/duration

3. Optimization V2 Tool (Code Ready, Not Registered)

  • Status: V2 API currently requires beta access
  • Code: Preserved in OptimizationV2Tool.ts (not registered in toolRegistry)
  • V2 Features: Time windows, capacity limits, vehicle capabilities, shipments, breaks
  • When V2 goes public: Uncomment one line in toolRegistry to enable

Implementation Details

  • Both tools extend MapboxApiBasedTool
  • Proper error handling and structured output
  • OpenTelemetry tracing integrated
  • All 421 tests passing ✅

SDK Update

Updates @modelcontextprotocol/sdk to 1.25.2 (CVE fix)

Test Coverage

  • MapMatchingTool: 9 tests
  • OptimizationTool (V1): 9 tests
  • All tests passing

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com

mattpodwysocki and others added 3 commits January 7, 2026 18:47
Implements two new Mapbox Navigation API tools:

- Map Matching Tool (map_matching_tool): Snaps GPS traces to roads
  - Supports 2-100 coordinates with optional timestamps and radiuses
  - Returns confidence scores, matched geometry, and annotations
  - Handles driving, cycling, walking, and driving-traffic profiles

- Optimization Tool (optimization_tool): Solves vehicle routing problems
  - Supports up to 1000 coordinates
  - Simplified mode: auto-generates vehicle and services
  - Advanced mode: custom vehicles, services, shipments, time windows
  - Async polling mechanism (POST + GET)

Both tools include:
- Complete input/output schemas with Zod validation
- Comprehensive unit tests (19 tests total)
- Proper annotations (readOnlyHint, openWorldHint, etc.)

All 422 tests passing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Update SDK from 1.25.1 to 1.25.2 which includes security fixes.
Update patch file to match new SDK version.

All 457 tests passing with updated SDK.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Switch optimization_tool to use V1 synchronous GET API (publicly available)
- V1 supports 2-12 coordinates, simple TSP, works immediately
- Preserve V2 implementation as OptimizationV2Tool (not registered)
- V2 code ready to enable when API becomes public
- Remove task-based infrastructure from main registration
- All 456 tests passing

V1 endpoint: GET /optimized-trips/v1/{profile}/{coordinates}
V2 endpoint: POST /optimized-trips/v2 (requires beta access)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@mattpodwysocki mattpodwysocki requested a review from a team as a code owner January 7, 2026 23:48
- Add Map Matching tool section with features and example usage
- Add Optimization tool section with features and example usage
- Note about V2 Optimization API implementation (beta access required)
- Update intro to mention route optimization and map matching capabilities
- Add new "GPS & Route Matching" example prompts section
- Add optimization example to Analysis & Planning section

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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.

1 participant