Skip to main content
Glama

Zip-Codes.com Location Intelligence: Spatial Analysis, Districts & 14+ Years of Demographics

Distance between two places

distance
Read-onlyIdempotent

Distance between two places, in miles and kilometres, plus the compass bearing from the first to the second. Each end takes a US ZIP Code, a US ZIP+4, a Canadian FSA, a Canadian postal code, or a latitude,longitude pair, and the two ends can be different kinds — a US ZIP to a Canadian postal code works, and so does a code to a coordinate. Time zone for both ends is included. This is a straight-line distance, not a driving route. Without an API key the distance itself is returned and the geography behind it is withheld.

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": {
      "from": "<from>",
      "to": "<to>"
    },
    "name": "distance"
  }
}

Input Schema

NameRequiredDescriptionDefault
toYesDestination, in any of the same forms as the origin.
fromYesOrigin: a ZIP Code, ZIP+4, Canadian FSA or postal code, or latitude,longitude. For example 90210, M5V 2T6, or 34.10,-118.41.
api_keyNoYour ZIP-Codes.com API key, only when you cannot send it as the X-Api-Key or Authorization: Bearer header (for example a key bought with buy_credits in this conversation). Leave it out to use the free tier. It is never shown back in a response.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / api_key
      Added value: +{
      +  "default": null,
      +  "description": "Your ZIP-Codes.com API key, only when you cannot send it as the X-Api-Key or Authorization: Bearer header (for example a key bought with buy_credits in this conversation). Leave it out to use the free tier. It is never shown back in a response.",
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
  2. Changed2 schema fields changed
    • addedInput schema / properties / from / type
      Added value: +"string"
    • addedInput schema / properties / to / type
      Added value: +"string"
  3. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive), and the description adds real behavioral context on top: free-tier degradation ('distance returned and the geography behind it is withheld'), that the API key is never echoed back, and that mixed end types are accepted. This is exactly the kind of non-obvious behavior an agent needs before calling.

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 result shape, then input forms, then the caveats; every sentence carries information. It is slightly dense at four sentences, and the time-zone sentence could merge with the return-value sentence, but nothing is filler.

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?

There is no output schema, so the description carries the return-value burden and does: miles, kilometres, compass bearing, and both time zones, plus what is missing on the free tier. For a 3-parameter read tool with annotations, nothing an agent needs to call it correctly is absent.

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

Parameters4/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, but the description adds semantics the schema doesn't: the two ends may be of different kinds (US ZIP to Canadian postal code, code to coordinate). It also restates the accepted formats and the free-tier meaning of api_key, though it adds no detail on coordinate precision or formatting edge cases.

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 computation (straight-line distance in miles/kilometres plus bearing) on a specific resource pair, and explicitly rules out the closest confusing alternative ('not a driving route'). An agent can distinguish it from radius_search or zip_lookup without opening the schema.

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

Usage Guidelines4/5

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

Clear context for when this applies (point-to-point distance between two arbitrary locations) and an explicit exclusion (not a driving route). It does not name a concrete sibling such as radius_search as the alternative for 'find places near X', so routing is inferred rather than stated.

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.