Skip to main content
Glama
Mapbox MCP Server

Mapbox MCP Server

Official
by mapbox

Measure Line Length

length_tool
Read-onlyIdempotent

Measure the total length of a line from coordinate pairs in kilometers, miles, meters, or feet to calculate drawn routes, paths, or boundaries without a routing API call or network access.

Instructions

Measure the total length of a line defined by a series of coordinates. Useful for measuring a drawn route, path, or boundary without a routing API call. Supports kilometers, miles, meters, and feet. 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": {
      "coordinates": "<coordinates>"
    },
    "name": "length_tool"
  }
}

Input Schema

NameRequiredDescriptionDefault
unitsNoUnits for the length measurementmeters
coordinatesYesLineString coordinates as [longitude, latitude] pairs

Output Schema

NameRequiredDescriptionDefault
unitsYesUnits of measurement
lengthYesTotal length of the line
num_coordinatesYesNumber of coordinate points in the line

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.5/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false, and openWorldHint=false, so the safety profile is covered. The description's "works offline without API calls" largely restates openWorldHint=false, and the supported-unit list restates the schema enum; no additional detail about accuracy, coordinate ordering, or edge cases is provided.

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?

The core purpose is front-loaded in the first sentence, and the follow-up sentences are short and readable. The final sentence ("Works offline without API calls") repeats the earlier "without a routing API call" idea, which is minor redundancy.

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, rich annotations, and full schema coverage, the description only needs to convey purpose and context, which it does. A small gap remains around coordinate ordering expectations and minimum-vertex behavior, but the schema covers those structurally.

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%, so both parameters and their formats ([longitude, latitude] pairs, units enum with default) are already fully documented in the schema. The description's unit list duplicates the enum and adds no format or constraint detail beyond it, making baseline 3 appropriate.

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?

The description gives a specific verb and resource ("Measure the total length of a line defined by a series of coordinates") and scopes it to drawn routes, paths, and boundaries, which separates it from point-to-point distance or routing tools without naming them. It stops short of explicitly naming a sibling such as distance_tool or directions_tool.

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?

"Useful for measuring a drawn route, path, or boundary without a routing API call" implies when this tool is appropriate and hints that directions/routing is an alternative. However, no sibling tool is named and there are no explicit when-not conditions or prerequisites, so the agent must infer the routing call it is substituting for.

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