calculate_route
Calculate real-world travel distance, duration, and route geometry between two points or place names, including optional waypoints and alternatives for driving, walking, or cycling.
Instructions
Calculate real-world travel distance, duration, turn-by-turn summary (with maneuver coordinates), GeoJSON route geometry, and route bounding box between two locations or coordinate pairs using OpenStreetMap routing (FOSSGIS / OSRM, or configurable OSRM_API_URL). Supports optional intermediate 'waypoints' and requesting 'alternatives' (up to 3 OSRM routes for side-by-side comparison with check_traffic_controls).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"origin": "<origin>",
"destination": "<destination>"
},
"name": "calculate_route"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| origin | Yes | Starting point as 'lat,lng' coordinates (e.g. '40.7128,-74.0060') or a natural-language place name (e.g. 'Times Square, NYC'). | |
| profile | No | Travel mode profile: 'driving' (car), 'walking' (foot), or 'cycling' (bicycle). Defaults to 'driving'. | |
| waypoints | No | Optional list of intermediate via-points ('lat,lng' or place names, up to 20) to force the route through specific streets or intersections. | |
| destination | Yes | Ending point as 'lat,lng' coordinates (e.g. '40.6413,-73.7781') or a natural-language place name (e.g. 'JFK Airport'). | |
| alternatives | No | If true, requests up to 3 alternative routes from OSRM (only supported when 'waypoints' is empty). Defaults to false. | |
| return_steps | No | If true, includes step-by-step road names, maneuver instructions, and turn coordinates. Defaults to false. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| steps | No | ||
| origin | Yes | ||
| profile | Yes | ||
| complete | Yes | ||
| warnings | Yes | ||
| share_url | Yes | ||
| waypoints | No | ||
| provenance | Yes | ||
| route_bbox | Yes | ||
| destination | Yes | ||
| distance_km | Yes | ||
| alternatives | No | ||
| detour_factor | Yes | ||
| route_geometry | Yes | ||
| distance_meters | Yes | ||
| initial_bearing | Yes | ||
| duration_minutes | Yes | ||
| duration_seconds | Yes | ||
| alternatives_count | No | ||
| straight_line_meters | Yes |