Skip to main content
Glama

geo_distance_matrix

Read-only

Distance matrix (offline) — Great-circle distance matrix between up to 25 origins and 25 destinations, offline. origins (and optional destinations) = lat,lon points separated by |, each optionally labeled as name=lat,lon; without destinations you get the symmetric matrix among the origins. Returns the distance matrix (units=km or mi), a road estimate matrix (straight line x roadFactor, default 1.3) with drive-hours at speed= (default 80 km/h or 50 mph), the nearest and farthest destination per origin with bearing, a greedy 1:1 origin-to-destination assignment, and min/max/mean. Haversine on the WGS84 mean radius; no network calls. Price: $0.003 USDC (Base, via x402).

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": {
      "origins": "<origins>",
      "destinations": "<destinations>"
    },
    "name": "geo_distance_matrix"
  }
}

Input Schema

NameRequiredDescriptionDefault
originsYese.g. Nashville=36.1627,-86.7816|Memphis=35.1495,-90.0490
destinationsYese.g. Atlanta=33.7490,-84.3880|Chicago=41.8781,-87.6298|Dallas=32.7767,-96.7970

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.8/5.0
Behavior3/5

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

Substantial disclosure beyond the annotations: output contents (nearest/farthest with bearing, greedy 1:1 assignment, min/max/mean), road-estimate defaults (roadFactor 1.3, speed 80 km/h), the Haversine/WGS84 mean-radius formula, and billing ($0.003 USDC via x402). The repeated "offline / no network calls" claim is in tension with openWorldHint=true and a crypto payment path that necessarily touches the network, leaving the side-effect profile slightly ambiguous.

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 purpose and cardinality, then output shape, defaults, and cost in a sensible order with no filler sentences. Slight redundancy: "offline" appears twice in the first clause and again as "no network calls".

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?

With no output schema, the description carries the full burden and does it: it enumerates every returned component (matrix, road estimate, nearest/farthest with bearing, greedy assignment, summary stats), the units, and the pricing. An agent could call this correctly from the description alone, apart from the required-vs-optional destinations error.

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 coverage is 100%, so the baseline is 3, and the description does add real meaning: the pipe separator, the optional name=lat,lon labeling, and the defaults for units, roadFactor, and speed that are not in the schema at all. However, it mis-describes destinations as optional when the schema requires it, a mismatch that could cause the agent to omit a required argument.

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 — a great-circle distance matrix — plus hard cardinality limits (up to 25 origins and 25 destinations). The matrix-of-pairs nature inherently separates it from a single-pair geo_distance tool, so an agent can tell the two apart 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 Guidelines3/5

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

It explains one usage mode ("without destinations you get the symmetric matrix among the origins") and the offline constraint, which implies when it is preferable to a networked geocoder. But it never names an alternative tool or an explicit when-not condition. Worse, it calls destinations "optional" while the schema marks it required, so the stated usage mode is not actually reachable as described.

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.

Resources