build_combined_route
Combines gravel segments from saved Komoot tours into a custom route, connects them with a cycling router, and saves the result as a GPX file for loops or point-to-point rides.
Instructions
Build a custom gravel route by combining the best segments from multiple saved tours.
Selects gravel segments from saved tours within a corridor between start and end, ordered by forward progress. Connects them via OSRM cycling router. Every km follows either a saved-tour path or a short OSRM connector.
For loops: omit end_lat/end_lon. For point-to-point: provide both.
Uses a disk cache for parsed segments: only fetches new tours from the API. Set force_refresh=True to re-fetch all tour data.
Args: tour_ids: List of Komoot tour IDs to extract segments from. start_lat: Starting point latitude. start_lon: Starting point longitude. distance_km: Target route distance in km (default 50). min_gravel_pct: Minimum gravel percentage target (default 60). route_name: Name for the combined route. save_path: File path to save GPX. Defaults to $KOMOOT_MCP_ROUTES_DIR/.gpx (or ~/komoot-mcp-routes/ when the variable is not set). use_saved_highlights: If True, fetch saved highlights and use as waypoint attractors (default True). force_refresh: If True, ignore cache and re-fetch all tour data from Komoot API (default False). end_lat: End point latitude (for point-to-point routes). Omit for loops. end_lon: End point longitude (for point-to-point routes). Omit for loops.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end_lat | No | ||
| end_lon | No | ||
| tour_ids | Yes | ||
| save_path | No | ||
| start_lat | Yes | ||
| start_lon | Yes | ||
| route_name | No | Gravel-AI route | |
| distance_km | No | ||
| force_refresh | No | ||
| min_gravel_pct | No | ||
| use_saved_highlights | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |