Skip to main content
Glama

Compare walk / cycle / drive

compare_modes
Read-onlyIdempotent

Walk vs cycle vs drive between two places, in one call.

Instructions

Walk vs cycle vs drive between two places, in one call.

"Should I walk, bike or drive from A to B?" is three route() calls;
this is one. The ends resolve exactly once and every mode routes
between the same two coordinates, so the rows are comparable. Use it
when the user is choosing a mode; when the mode is already known,
route() or from_to() gives the fuller answer (export maps/gpx/text,
optional polyline).

Pass each of from/to as a free-text place name, a {"lat", "lon"} dict,
or a GERS id — mixed freely, exactly as from_to takes them.
Do not call geocode(), resolve_place(), or geocode_batch() first. modes
is an optional subset of ["walk", "cycle", "drive"]; omitted means all three
in that order (stored mode preferences are not consulted — every mode
asked for is computed). A mode outside that vocabulary, or an empty
list, returns {"error": "bad_request"}; duplicates collapse, order kept.

Returns {"from", "to", "modes", "fastest", "shortest", "summary"}.
"from"/"to" carry what each end resolved to (name/id when the input was
a name or GERS id, lat/lon always). "modes" is one compact row per
requested mode, in the requested order: {"mode", "distance_m",
"duration_s", "duration_min"} — no path, no export, no per-row
endpoints; with include_elevation=true a row also carries
"total_climb_m"/"total_descent_m" where the DEM covered the route
(never faked as 0). "fastest"/"shortest" name the mode with the lowest
duration/distance among the rows that routed, or null if none did.
"summary" is a short deterministic sentence or two built from the rows.

A mode that cannot be routed fails inline in its own row — {"mode",
"error", "detail"} — and never aborts the call: "too_far" when the ends
exceed that mode's straight-line cap (walk ~7.5 km, cycle ~23.5 km,
drive ~95.5 km — so a cross-town pair often gives a drive row and a
too_far walk row), "needs_confirm" with its eta/eta_s when that mode's
street graph is cold and confirm is false, or whatever error route()
returned (no_graph_nearby, no_route, ...). Only end resolution fails
the whole call: {"error": "ambiguous_place" | "not_found" |
"bad_request"} with "field": "from" | "to", as from_to does.

Same cost model as route(): walk 1.4 m/s, cycle 4.2 m/s, drive from
posted speed limits or a class default — a posted-speed model with no
live traffic, which the summary says whenever drive routed.

confirm=true after the user agreed to wait for a first-time street-graph
build (about 5–25 seconds per cold mode — each mode is its own graph).
Pass it only after a needs_confirm row and they said yes. A warm or
cached graph never needs it. Omit confirm unless you just asked and
they said yes.

Input Schema

NameRequiredDescriptionDefault
toYes
fromYes
modesNoModes to compare, in answer order. Default: walk, cycle, drive.
confirmNo
include_elevationNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.11.0

TDQS

A4.9/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations only cover the safety profile (readOnly/idempotent/non-destructive). The description adds cost model (walk 1.4 m/s, cycle 4.2 m/s, drive from posted limits with no live traffic), per-mode inline failure semantics that never abort the call, straight-line caps per mode, and a 5–25 s cold-graph build cost for confirm — none of which is inferable from structured fields.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the one-sentence purpose and the routing decision, then layered details. Dense and nearly all sentences earn their place, but it is long (~400 words) with some restatement (mode ordering/omission is explained twice), so not maximally tight.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values need not be documented — yet the description still enumerates the response shape, row contents, fastest/shortest selection, and error payloads. Combined with error taxonomy and confirm prerequisites, an agent has everything needed to call and interpret it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is only 20%, so the description must carry the load, and it does: from/to accept free-text, {lat,lon} dict, or GERS id mixed freely; modes is an optional subset of the three values with a defined default order, duplicates collapsing, and an error on empty/invalid input; include_elevation's effect on rows is specified.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource with scope: compare walk/cycle/drive between two places in one call. It explicitly frames the tool against its siblings ('three route() calls; this is one') so an agent can distinguish it from route()/from_to() without opening either schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit when-to-use ('Use it when the user is choosing a mode') and when-not ('when the mode is already known, route() or from_to() gives the fuller answer'), plus a hard exclusion ('Do not call geocode(), resolve_place(), or geocode_batch() first') and precise confirm=true guidance tied to a needs_confirm row.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.