> ## Documentation Index
> Fetch the complete documentation index at: https://docs.justrouting.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Route Tool

> Calculate one driving route between two locations — distance, duration, geometry, and road information.

## Overview

Calculate a route between two locations.

Use this tool when the user needs to:

* calculate driving distance
* estimate travel time
* get a route between two locations
* get route geometry
* understand which roads a route uses
* avoid specific road types

Do not use it for comparing many origin-destination pairs. Use [`table`](/mcp/table) instead.

Do not use it for assigning jobs to vehicles or ordering multiple stops. Use [`optimize`](/mcp/optimize) instead.

## Input

```json theme={null}
{
  "origin": "103.8198,1.3521",
  "destination": "103.9915,1.3644"
}
```

Coordinates must use:

```text theme={null}
longitude,latitude
```

For example:

```text theme={null}
103.8198,1.3521
```

## Motorcycle routing

`profile` is optional.

Set it to `"motorcycle"` when the user explicitly asks for a motorcycle or motorbike route.

Otherwise, omit `profile` to use the default driving profile.

```json theme={null}
{
  "origin": "103.8198,1.3521",
  "destination": "103.9915,1.3644",
  "profile": "motorcycle"
}
```

## Avoiding roads

Use `exclude` when the user explicitly asks to avoid a road type.

Supported values:

* `toll`
* `motorway`
* `ferry`

For example:

```json theme={null}
{
  "origin": "103.8198,1.3521",
  "destination": "103.9915,1.3644",
  "exclude": ["toll"]
}
```

Road avoidance is a preference, not a guarantee. The engine avoids the specified road type when a reasonable alternative exists.

## Output

```json theme={null}
{
  "distance_meters": 18500,
  "duration_seconds": 1500,
  "profile": "driving",
  "origin": {
    "input": "103.8198,1.3521",
    "snapped": [103.8197, 1.3520],
    "name": "Example Road",
    "distance": 4.2
  },
  "destination": {
    "input": "103.9915,1.3644",
    "snapped": [103.9915, 1.3644],
    "name": "Airport Boulevard",
    "distance": 8.1
  },
  "geometry": "ka|`@_ceeEnAqB...",
  "summary": {
    "roads": ["East Coast Parkway"],
    "tolls": false,
    "ferry": false
  }
}
```

* `distance_meters` — route distance in meters
* `duration_seconds` — estimated travel time in seconds
* `profile` — routing profile used
* `geometry` — simplified encoded polyline for the route
* `summary.roads` — main roads used by the route
* `summary.tolls` — whether the route uses toll roads
* `summary.ferry` — whether the route includes a ferry crossing

If the user provides place names or addresses instead of coordinates, call [`geocode`](/mcp/geocode) first.

## Example

Prompt for an MCP-capable agent, e.g. Claude or Codex

```markdown theme={null}
How long does it take to drive from Marina Bay Sands Singapore to Changi Airport?

# Driving from Marina Bay Sands to Changi Airport takes about 23-24 minutes (23.6 min), covering roughly 19 km.
# 
# Route details:
# - Main roads: East Coast Parkway (ECP), Airport Boulevard
# - Distance: ~19.1 km
# - Time: ~23 min 36 s
# - Tolls: Yes — expect ERP charges along the ECP
#
# Note that actual travel time varies with traffic, which tends to be heavier during weekday peak hours.

What if I'm riding a motorcycle?

# On a motorcycle, the trip is about 26-27 minutes — slightly longer than by car:
# ┌──────────┬───────────────────┬───────────────────────┐
# │          │        Car        │      Motorcycle       │
# ├──────────┼───────────────────┼───────────────────────┤
# │ Distance │ ~19.1 km          │ ~19.1 km (same route) │
# ├──────────┼───────────────────┼───────────────────────┤
# │ Time     │ ~23.6 min         │ ~26.5 min             │
# ├──────────┼───────────────────┼───────────────────────┤
# │ Roads    │ ECP, Airport Blvd │ ECP, Airport Blvd     │
# ├──────────┼───────────────────┼───────────────────────┤
# │ Tolls    │ Yes (ERP)         │ Yes (ERP)             │
# └──────────┴───────────────────┴───────────────────────┘
#
# The route stays the same along the East Coast Parkway, but the motorcycle profile assumes slower average speeds.
# ERP charges apply to motorcycles too, though at lower rates than cars.

What if I want to avoid tolls?

# Avoiding tolls on a motorcycle changes the route:
# ┌──────────┬────────────────────────┬──────────────────────────────────────────┐
# │          │ Motorcycle, with tolls │           Motorcycle, no tolls           │
# ├──────────┼────────────────────────┼──────────────────────────────────────────┤
# │ Distance │ ~19.1 km               │ ~21.6 km                                 │
# ├──────────┼────────────────────────┼──────────────────────────────────────────┤
# │ Time     │ ~26.5 min              │ ~35 min                                  │
# ├──────────┼────────────────────────┼──────────────────────────────────────────┤
# │ Route    │ ECP, Airport Blvd      │ Nicoll Highway → ECP (past ERP gantries) │
# ├──────────┼────────────────────────┼──────────────────────────────────────────┤
# │ Tolls    │ Yes (ERP)              │ None                                     │
# └──────────┴────────────────────────┴──────────────────────────────────────────┘
#
# The toll-free route adds about 2.5 km and ~8-9 minutes. It heads via Nicoll Highway and joins the East Coast Parkway
# after the ERP gantries. Worth it if you'd rather trade time for savings, especially since ERP rates are lowest
# outside peak hours anyway.
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.