Skip to main content
Glama

Distance Calculator

DistanceCalculator
Read-only

Distance Calculator: Distance Calculator computes the distance between two coordinate pairs in miles and kilometers. Supply two latitude and longitude points to receive distances and resolved city and state names for both locations. (Cost: 2 credits)

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": {
      "lat1": "<lat1>",
      "lon1": "<lon1>",
      "lat2": "<lat2>",
      "lon2": "<lon2>"
    },
    "name": "DistanceCalculator"
  }
}

Input Schema

NameRequiredDescriptionDefault
lat1YesThe latitude of the first location
lat2YesThe latitude of the second location
lon1YesThe longitude of the first location
lon2YesThe longitude of the second location

Output Schema

NameRequiredDescriptionDefault
dataNo
errorNoError message, null on success
statusNo"ok" on success

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.2/5.0
Behavior3/5

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

Annotations already cover the safety profile (readOnlyHint, destructiveHint=false, openWorldHint), so the bar is lower, and the description does add genuinely useful context: a 2-credit cost and the fact that city/state names are resolved alongside distances. It does not disclose distance formula/accuracy, unit rounding, or failure behavior for invalid coordinates (e.g., out-of-range or sea points).

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

Conciseness3/5

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

It is short, but the first sentence opens by repeating the tool name and title verbatim ("Distance Calculator: Distance Calculator computes..."), which wastes the most prominent position. The credit cost is usefully placed at the end but is parenthetically buried.

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?

The tool is simple, an output schema exists so return values need only be summarized, and the description does summarize them (miles, kilometers, resolved city/state) plus the credit cost. The main remaining gap is coordinate format/validity, which is left entirely to the schema.

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% and each of the four parameters carries a description and example, so the baseline of 3 applies. The description adds nothing beyond the schema – no mention that coordinates are decimal degrees, expected ranges, or that lat/lon pairs are positional (lat1 with lon1).

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?

"computes the distance between two coordinate pairs in miles and kilometers" gives a specific verb, resource, and unit, and adds that city/state names are resolved. It does not distinguish itself from nearby siblings such as AirportDistance or LevenshteinDistance, so an agent must infer the coordinate-pair distinction from the schema rather than the text.

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

Usage Guidelines2/5

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

The description states what input to supply but never says when to prefer this over AirportDistance (airport-to-airport) or ReverseGeocode, nor does it give exclusions or prerequisites. The only guidance is the implied "supply two lat/lon points" which is already forced by the required schema.

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.