Skip to main content
Glama

matrix

Compute a travel time/distance matrix between origins (rows) and destinations (columns). Costing "auto", "truck" (with optional truck profile as in route), "bicycle", "pedestrian" or "motor_scooter". Returns durations_s[i][j] in seconds and distances_m[i][j] in metres; null cells are unreachable pairs. Up to 10,000 cells per call (origins × destinations). Optional exclude_polygons for before/after scenarios ("close this bridge and recompute the matrix"): an array of polygons, each an array of [lon, lat] pairs forming one ring — longitude FIRST — whose intersecting roads are excluded from every cell's path finding. Applies to the Valhalla engine; unsupported on the GraphHopper engine, where it is ignored.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
truckNoTruck profile (dimensions + ADR declaration). Requires costing "truck".
costingNoCosting model: "auto" (default), "truck", "bicycle", "pedestrian" or "motor_scooter".auto
originsYesOrigin locations (matrix rows).
destinationsYesDestination locations (matrix columns).
exclude_polygonsNoAreas to avoid — scenario analysis ("close this bridge and recompute the matrix"): an array of polygons, each an array of `[lon, lat]` pairs forming one exterior ring (GeoJSON-style, longitude FIRST). Roads intersecting any ring are excluded from every cell's path finding. Applies to the Valhalla engine; unsupported on the GraphHopper engine, where it is ignored.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
distances_mYesTravel distances in metres, same shape as `durations_s`. Null cells are unreachable pairs.
durations_sYesTravel times in seconds; `durations_s[i][j]` is origin `i` → destination `j`. Null cells are unreachable pairs.

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It responsibly reveals the exact output units, null cells for unreachable pairs, the 10,000-cell cap, and the engine-specific behavior of exclude_polygons (Valhalla supported, GraphHopper ignored). This is strong transparency for a read-only compute tool, though it stops short of discussing timeout/error handling.

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?

The description is four sentences, front-loaded with the core action and followed by essential operational details. Every sentence contributes useful information (costing modes, return fields, cell limit, polygon behavior) with no filler. It could be tightened slightly for readability but is well within acceptable density.

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

Completeness4/5

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

Given the tool's complexity and the presence of an output schema, the description is nearly complete: it specifies what is returned, limits, engine compatibility, and the purpose of the optional parameter. The only minor omissions are edge-case behavior (e.g., what happens when exceeding the cell limit) and explicit auth/rate-limit info, but these are not critical for invoking the tool correctly.

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

Parameters3/5

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

Schema description coverage is 100%, so the baseline is 3. The description adds some conceptual framing—'origins (rows)' and 'destinations (columns)'—and the engine caveat for exclude_polygons, but this largely mirrors what the schema already says. It does not materially deepen parameter understanding beyond the structured definitions.

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?

The description opens with a precise verb and resource: 'Compute a travel time/distance matrix between origins (rows) and destinations (columns).' It clearly distinguishes this from the sibling 'route' tool by focusing on multi-origin/multi-destination matrix output, and the mention 'as in route' only serves as a cross-reference for the truck profile. No ambiguity about what the tool does.

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

Usage Guidelines3/5

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

The description implies the use case ('before/after scenarios' for exclude_polygons) and states hard limits (10,000 cells) but never explicitly says when to choose this over alternatives like 'route' for single pairs or 'reachable_area' for isochrones. An agent must infer the matrix-vs-route distinction from the tool name and purpose rather than from explicit guidance.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

TDQS

A4/5.0
Disambiguation4/5

Most tools target a distinct action and resource pair, and descriptions are explicit about which tool fits which scenario. The closest overlaps—plan_ev_route vs cheapest_charging_along_route, and route vs plan_day vs order_stops vs optimise_routes—are mitigated by clear guidance, so an agent can usually pick correctly.

Naming Consistency4/5

Tool names overwhelmingly follow a verb_noun snake_case pattern (plan_ev_route, set_palette, list_style_layers) with a consistent geo_ prefix for geometry helpers. Minor deviations like elevation, route, and matrix are short and readable but break the strict verb_noun convention.

Tool Count2/5

At 39 tools, this surface is well past the 25+ threshold and feels heavy even for a broad mapping platform. The set spans routing, geocoding, places, styles, EV/fuel, telematics, usage, and feedback, which would be easier for an agent to navigate if split into smaller domain-focused servers.

Completeness4/5

For the stated breadth, coverage is strong: routing, multi-stop planning, VRP, EV/fuel detours, geocoding, places, geometry, style lifecycle, and telematics all have workable primary paths. Minor gaps like no style deletion, no route alternatives, and no batch geocoding are present but do not create dead ends for core workflows.

Resources