Skip to main content
Glama

UK Data: Maths and statistics

calculate_distance

Read-onlyIdempotent

Calculates the great-circle distance between two geographic points using the Haversine formula. Returns distance in kilometers, miles, or nautical miles. (cost: 1 credit)

Input Schema

NameRequiredDescriptionDefault
lat1Nonumber, required, latitude of first point, decimal degrees, no default
lat2Nonumber, required, latitude of second point, decimal degrees, no default
lon1Nonumber, required, longitude of first point, decimal degrees, no default
lon2Nonumber, required, longitude of second point, decimal degrees, no default
unitNostring, optional, unit of measurement (km/miles/nautical), no unit, default km

Schema Changelog

Changes observed during successful MCP inspections.

  1. 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, non-destructive and open-world, so the safety profile is covered. The description adds genuinely new behavioral facts beyond those annotations: the underlying formula (fixed, deterministic result) and a per-call cost of 1 credit, which affects agent planning. It stops short of stating valid coordinate ranges or error behavior, which keeps it below a 5.

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 short sentences: the purpose and algorithm come first, the return format and cost second. No filler and nothing requiring the reader to scan ahead.

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 simple pure-computation tool with full schema coverage, no output schema needed, and annotations covering safety, the definition tells the agent essentially everything required to call it. The only gap is that valid latitude/longitude bounds and out-of-range behavior are unstated, which is a minor omission rather than a blocking one.

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%, with every parameter documented including units ('decimal degrees') and the default of km for unit. The description only echoes the unit options already in the schema and adds no semantics about accepted string-vs-number coordinate formats or hemisphere sign conventions, so baseline 3 applies.

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 precise verb and resource ('Calculates the great-circle distance between two geographic points'), names the algorithm (Haversine), and specifies the returned units. This clearly separates it from numeric siblings such as euclidean_distance without needing the schema opened.

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 is implied by the domain: coordinates in degrees means geographic distance, which is enough for an agent to pick it over euclidean_distance. However, there is no explicit when-to-use statement, no mention of the alternative tool, and no note about precision limits or spherical-vs-ellipsoidal assumptions.

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