Skip to main content
Glama

Moltline Optimize

Distance Matrix Haversine

distance_matrix_haversine
Read-onlyIdempotent

Straight-line (great-circle) distance matrix from coordinates. FREE.

Typical input {"points": [{"id": "depot", "lat": 51.5, "lon": -0.12}, {"id": "A", "lat": 51.52, "lon": -0.1}]} returns {"matrix": [[0, 2.6], [2.6, 0]], "unit": "km", "kind": "straight-line (haversine), not road distance"}. Use when you have no road matrix and a straight-line approximation is acceptable, or to sanity-check one. Not road routing: real driving distances are longer and the difference is not uniform. Errors: on invalid, missing, or malformed input this tool never raises a protocol error; it returns {"error": ""} (for example {"error": "points must be a list of at least two objects"}). Every call is read-only and idempotent, so after correcting the input it is always safe to retry.

Input Schema

NameRequiredDescriptionDefault
unitNokm (default) or mi.km
pointsYeslist of {id, lat, lon} (up to 200).

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Drops the annotations' boilerplate and adds genuine behavioral contract: it never raises a protocol error, returns {"error": ...} with a corrective message, and retry is always safe after fixing input. It also warns that road distances are longer by a non-uniform factor, which is the key modeling caveat an agent needs.

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-loads what it is and that it is FREE, then example, then when-to-use, then error contract. Dense but every sentence carries information; the embedded JSON blobs make it visually heavy though compact in total length.

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?

Despite an output schema existing, the description still sketches the return shape (matrix, unit, kind), and it covers input limits, error behavior, and retry safety. Nothing an agent needs to call this correctly is missing.

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 already 100% (km/mi enum-less unit, points up to 200), so the baseline is 3. The description exceeds that by showing a concrete points payload with id/lat/lon and a concrete matrix/unit response shape, which makes the required structure unambiguous.

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 verb+resource and its exact geometric basis: 'Straight-line (great-circle) distance matrix from coordinates', reinforcing it with 'kind: straight-line (haversine), not road distance'. This separates it cleanly from the road-routing siblings route_plan and route_plan_fleet.

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?

Gives a clear positive condition ('no road matrix and a straight-line approximation is acceptable, or to sanity-check one') and an explicit exclusion ('Not road routing'). Slight gap: it describes the alternative conceptually rather than naming the sibling tools an agent should switch to.

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.