Skip to main content
Glama

cn402_geo_distance

Calculate the haversine (great-circle) distance between two latitude/longitude coordinates. Returns the distance in kilometers between any two points on Earth.

Instructions

Geo distance calculator / haversine distance / great circle distance / lat long distance / GPS coordinate distance / 经纬度距离 / kilometer between two coordinates / point-to-point distance Earth / geographic distance API. Compute great-circle (haversine) distance between two latitude/longitude coordinates.

Price: unknown on Base (auto-paid in USDC).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
lat1YesFirst point latitude (required)
lat2YesSecond point latitude (required)
lng1YesFirst point longitude (required)
lng2YesSecond point longitude (required)
Behavior2/5

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

Without annotations, the description must disclose behavioral traits. It mentions the algorithm (haversine) and implies output in kilometers via the synonym 'kilometer between two coordinates', but it does not specify the exact return format, units, error handling (e.g., invalid coordinates), or performance characteristics. The pricing note is extraneous and does not aid core behavioral understanding.

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

Conciseness2/5

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

The description is bloated with a long list of alternative names that are redundant given the tool name. The core functionality is covered in one sentence; the rest is unnecessary. The pricing note is irrelevant and adds noise. The description should be front-loaded with the computation sentence and omit the synonym list and pricing.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given there is no output schema and no annotations, the description should explain the return value (e.g., distance in kilometers, numeric type) and any constraints (e.g., valid lat/lng ranges, handling of edge cases). It fails to do so, leaving the agent uncertain about what the tool returns and how to interpret errors. The completeneness is inadequate for reliable invocation.

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 description coverage is 100% with basic parameter descriptions ('First point latitude'). The description adds value by clarifying that the output unit is kilometers (via the phrase 'kilometer between two coordinates'), which is not in the schema. This additional semantic helps the agent understand the expected output, earning a score above baseline.

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?

The description explicitly states it computes great-circle (haversine) distance between two lat/lng coordinates, using multiple synonyms to reinforce the purpose. It clearly differentiates from sibling geo tools like cn402_geo_cn_city (city lookup) and cn402_geo_timezone. The verb 'compute' and resource 'distance' are highly specific.

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 offers no guidance on when to use this tool versus alternatives, such as other geo tools or distance calculators. It does not state prerequisites (e.g., valid coordinate ranges) or when it might be inappropriate (e.g., for short distances where great-circle approximation is fine but not specified). The context of payment is mentioned but not relevant to usage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/x402node/x402-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server