Skip to main content
Glama

Calculate cross track error

calculate_cross_track_error

Calculate cross track error (XTE) — the perpendicular distance from a vessel position to the great-circle track between two waypoints — plus side of track (port/starboard) and along-track distances.

Input Schema

NameRequiredDescriptionDefault
endYesTrack end waypoint (B).
startYesTrack start waypoint (A).
positionYesVessel position (P).

Output Schema

NameRequiredDescriptionDefault
xteYesCross track error magnitude — perpendicular distance from position to track.
sideYesSide of the track the position lies on, travelling start → end.
beyondEndYesTrue when the abeam point falls beyond the end waypoint.
remainingYesDistance remaining along the track from the abeam point to the end waypoint.
alongTrackYesDistance from start along the track to the point abeam of the position. Negative when the position is abeam a point behind the start.
beforeStartYesTrue when the abeam point falls before the start waypoint.
nearestPointYesNearest point on the track (foot of the perpendicular), decimal degrees.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.9/5.0
Behavior4/5

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

No annotations are supplied, so the description carries the full burden. It makes clear this is a pure, stateless geometric computation with no side effects, and it discloses the conventions of the result (side of track reported as port/starboard, plus along-track distances). It stops short of stating units or input validation behavior such as what happens with degenerate waypoints.

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?

A single, front-loaded sentence that defines the metric before listing outputs. It is tight, though the trailing clause about port/starboard and along-track distances restates material that the output schema already covers.

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?

With an output schema present, return values need not be explained, and all three required parameters are fully documented in the schema. The only gap is the absence of guidance linking it to the related bearing/distance tools, which is minor for a self-describing calculation.

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 lat/lng field documents accepted formats (signed decimal, hemisphere letter, DDM, DMS) in detail. The description adds only the semantic mapping of the three points (two waypoints plus vessel position), so the schema does the heavy lifting and a 3 baseline 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 specific verb (calculate) and a precisely defined resource (cross track error), then spells out the geometry: perpendicular distance from a position to the great-circle track between two waypoints. This is unambiguous and clearly distinct from siblings like calculate_distance or calculate_bearing.

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?

The definition of XTE implicitly tells an agent when the tool applies, but it never explicitly states when to prefer it over calculate_distance or calculate_bearing, nor any preconditions. Usage is inferable rather than stated.

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