Skip to main content
Glama

Distance

distance
Read-onlyIdempotent

Great-circle (haversine) distance between two lat/lon points. Returns the distance in km, miles, nautical miles, meters & feet, plus the initial compass bearing from point 1 to point 2.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
lat1YesLatitude of point 1 (decimal degrees).
lat2YesLatitude of point 2.
lon1YesLongitude of point 1.
lon2YesLongitude of point 2.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "lat1": 40.7128,
      +    "lat2": 51.5074,
      +    "lon1": -74.006,
      +    "lon2": -0.1278
      +  },
      +  {
      +    "lat1": 34.0522,
      +    "lat2": 37.7749,
      +    "lon1": -118.2437,
      +    "lon2": -122.4194
      +  }
      +]
  2. First observed

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, and non-destructive behavior. Description adds useful context by naming the haversine formula and detailing the output (multiple distance units and bearing), enhancing transparency.

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?

Single sentence efficiently communicates purpose and output without extraneous words. Every part is essential.

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?

Description covers input (lat/lon points) and output (distance in multiple units and bearing). With no output schema, the description adequately explains what the tool returns, leaving little ambiguity.

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?

Parameter schema has 100% coverage with descriptions, and the description adds the algorithm name but no additional parameter-specific meaning beyond what the schema provides. Baseline of 3 is appropriate as description adds marginal value.

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?

Description clearly states it computes great-circle distance and bearing between two lat/lon points, specifying output in multiple units. No sibling tool performs the same function, so it distinguishes well.

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?

No explicit when-to-use or when-not-to-use guidance is provided. Context implies use for geographic distance calculations, but no alternatives or exclusions are mentioned.

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.