Skip to main content
Glama
Mapbox MCP Server

Mapbox MCP Server

Official
by mapbox

Calculate Bearing

bearing_tool
Read-onlyIdempotent

Calculate the compass direction from a starting coordinate to an ending coordinate, returning degrees where 0° is North, 90° is East, 180° is South, and 270° is West. Works offline without API calls.

Instructions

Calculate the bearing (compass direction) from one point to another. Returns bearing in degrees where 0° is North, 90° is East, 180° is South, and 270° is West. Works offline without API calls.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "from": "<from>",
      "to": "<to>"
    },
    "name": "bearing_tool"
  }
}

Input Schema

NameRequiredDescriptionDefault
toYesEnding coordinate
fromYesStarting coordinate

Output Schema

NameRequiredDescriptionDefault
toYes
fromYes
bearingYesBearing in degrees (0-360, where 0 is North)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.18.1
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. First observedv0.12.6

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, closed-world), so the bar is lower, and the description still adds real value: the output convention (0°=North, 90°=East, 180°=South, 270°=West) and the fact that no network/API call is involved. It stops short of noting edge cases such as identical from/to points or whether the calculation is great-circle or rhumb-line.

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?

Three short sentences, front-loaded with the core purpose and immediately followed by output semantics. No filler or restated metadata; every sentence contributes.

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?

An output schema exists, so return values need not be explained, yet the description still specifies the unit and orientation convention, which is the key thing an agent needs to interpret results. The only meaningful omission is handling of degenerate inputs (identical points) and the geodesic model used.

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 both nested coordinate objects are documented as 'Starting coordinate' and 'Ending coordinate', so the schema carries the burden. The phrase 'from one point to another' reinforces the directional from→to ordering, which is mildly useful but adds little beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Calculate the bearing') and disambiguates the term with '(compass direction) from one point to another'. It does not, however, differentiate itself from nearby siblings such as destination_tool or directions_tool, which an agent could plausibly confuse with a directional calculation.

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 only implied by the two-coordinate input; there is no explicit statement of when to choose this over destination_tool (inverse operation) or directions_tool (routing). The note that it 'works offline without API calls' hints at a context where it is preferable, but no alternative is named or excluded.

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