Skip to main content
Glama

Distance between two places

distance
Read-onlyIdempotent

Road distance and travel time between two places, each a latitude/longitude point or an address (an address is looked up first, as the geocode tool does), or the straight-line distance with vehicle=direct. Costs $0.001, plus $0.001 for each address looked up; nothing is charged if an address is not found or no route is found.

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": {
      "origin": "<origin>",
      "destination": "<destination>"
    },
    "name": "distance"
  }
}

Input Schema

NameRequiredDescriptionDefault
unitsNoDistance units: miles or kilometers.mi
originYesA point {latitude, longitude}, or an address as text.
vehicleNoTravel mode. direct gives the straight-line (great-circle) distance with no travel time.auto
priorityNoFastest or shortest road route.fast
destinationYesA point {latitude, longitude}, or an address as text.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed12 schema fields changed
    • removedInput schema / properties / destination / additionalProperties
      Removed value: -false
    • addedInput schema / properties / destination / anyOf
      Added value: +[
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "latitude": {
      +        "description": "Latitude in decimal degrees (WGS84).",
      +        "maximum": 90,
      +        "minimum": -90,
      +        "type": "number"
      +      },
      +      "longitude": {
      +        "description": "Longitude in decimal degrees (WGS84).",
      +        "maximum": 180,
      +        "minimum": -180,
      +        "type": "number"
      +      }
      +    },
      +    "required": [
      +      "latitude",
      +      "longitude"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "description": "An address, e.g. \"350 5th Avenue, New York, NY 10118, USA\".",
      +    "minLength": 1,
      +    "type": "string"
      +  }
      +]
    • addedInput schema / properties / destination / description
      Added value: +"A point {latitude, longitude}, or an address as text."
    • removedInput schema / properties / destination / properties
      Removed value: -{
      -  "latitude": {
      -    "description": "Latitude in decimal degrees (WGS84).",
      -    "maximum": 90,
      -    "minimum": -90,
      -    "type": "number"
      -  },
      -  "longitude": {
      -    "description": "Longitude in decimal degrees (WGS84).",
      -    "maximum": 180,
      -    "minimum": -180,
      -    "type": "number"
      -  }
      -}
    • removedInput schema / properties / destination / required
      Removed value: -[
      -  "latitude",
      -  "longitude"
      -]
    • removedInput schema / properties / destination / type
      Removed value: -"object"
    • removedInput schema / properties / origin / additionalProperties
      Removed value: -false
    • addedInput schema / properties / origin / anyOf
      Added value: +[
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "latitude": {
      +        "description": "Latitude in decimal degrees (WGS84).",
      +        "maximum": 90,
      +        "minimum": -90,
      +        "type": "number"
      +      },
      +      "longitude": {
      +        "description": "Longitude in decimal degrees (WGS84).",
      +        "maximum": 180,
      +        "minimum": -180,
      +        "type": "number"
      +      }
      +    },
      +    "required": [
      +      "latitude",
      +      "longitude"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "description": "An address, e.g. \"350 5th Avenue, New York, NY 10118, USA\".",
      +    "minLength": 1,
      +    "type": "string"
      +  }
      +]
    • addedInput schema / properties / origin / description
      Added value: +"A point {latitude, longitude}, or an address as text."
    • removedInput schema / properties / origin / properties
      Removed value: -{
      -  "latitude": {
      -    "description": "Latitude in decimal degrees (WGS84).",
      -    "maximum": 90,
      -    "minimum": -90,
      -    "type": "number"
      -  },
      -  "longitude": {
      -    "description": "Longitude in decimal degrees (WGS84).",
      -    "maximum": 180,
      -    "minimum": -180,
      -    "type": "number"
      -  }
      -}
    • removedInput schema / properties / origin / required
      Removed value: -[
      -  "latitude",
      -  "longitude"
      -]
    • removedInput schema / properties / origin / type
      Removed value: -"object"
  2. First observed

TDQS

A4/5.0
Behavior5/5

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

With readOnlyHint, idempotentHint, and destructiveHint=false already covering the safety profile in annotations, the description adds genuinely new behavioral facts: a $0.001 base cost, an extra $0.001 per address geocoded, and the important guarantee that unresolved addresses or unroutable pairs are not charged. That billing and failure-charging semantics are exactly the kind of context an agent cannot get 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.

Conciseness5/5

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

Two sentences with no filler. The core capability and its address-lookup behavior come first, followed by the cost model, so the reader gets the most decision-relevant information up front.

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?

For a five-parameter tool with full schema coverage and no output schema, the description covers capability, input modes, and cost. It notes that direct mode returns no travel time, which is the main return-shape caveat an agent needs. Minor gaps remain around error responses or unit defaults for travel time, but these are low-impact.

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 units, vehicle, priority, and both point/address forms are already documented in the schema. The description reinforces the direct-vehicle mode and the fact that string inputs trigger a lookup, but adds no syntax or format detail beyond the schema. Baseline 3 applies.

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

Purpose4/5

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

The description gives a specific verb-and-resource pair: road distance and travel time between two places, accepting either coordinates or addresses, plus a straight-line mode via vehicle=direct. It distinguishes itself from geocode by explaining that address inputs are resolved internally 'as the geocode tool does'. It stops short of naming the route sibling, so an agent must infer how this differs from turn-by-turn routing.

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?

Usage guidance is implied through the mode description: use the default road mode for driving distance/time and vehicle=direct for straight-line distance with no travel time. There is no explicit statement of when to prefer route or geocode instead, and no precondition guidance beyond accepting addresses.

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