Skip to main content
Glama
Mapbox MCP Server

Mapbox MCP Server

Official
by mapbox

Nearest Point

nearest_point_tool
Read-onlyIdempotent

Find the nearest point in a collection to a target location, such as the closest store, stop, or landmark. Works offline without API calls.

Instructions

Find the nearest point in a collection to a given target point. More efficient than calling distance_tool for each candidate and sorting. Useful for finding the closest store, stop, or landmark to a location. 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": {
      "target": "<target>",
      "points": "<points>"
    },
    "name": "nearest_point_tool"
  }
}

Input Schema

NameRequiredDescriptionDefault
unitsNoDistance units for the resultmeters
pointsYesCandidate points to search
targetYesThe reference point to measure from

Output Schema

NameRequiredDescriptionDefault
indexYesIndex of the nearest point in the input array
unitsYesDistance units
nearestYesThe nearest point
distanceYesDistance from target to nearest point

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

A4.1/5.0
Behavior4/5

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

Annotations already establish read-only, idempotent, non-destructive, and closed-world behavior. The description adds useful context beyond that: it works offline without API calls and is more efficient than repeated distance_tool calls plus sorting, though it does not discuss tie-breaking or equidistant candidates.

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 purpose is front-loaded in the first sentence, and the remaining sentences add useful efficiency and usage context. It is compact overall, though the examples and offline note are slightly more than the minimum needed.

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, and annotations already cover safety and idempotency, so the description does not need to explain return values or side effects. It covers the core purpose and efficiency rationale well, but leaves edge cases such as equal-distance ties unmentioned.

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 coverage is 100%, so target, points, and units are already fully documented in the schema. The description only conceptually refers to the target and collection, adding no syntax, unit, or shape details beyond the structured schema.

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?

The description states a specific verb and resource: find the nearest point in a collection to a target point. It also distinguishes the operation from distance_tool by framing this as a more efficient alternative when sorting many candidate distances.

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?

It clearly describes when to use this tool: finding the closest candidate among many points, with examples such as stores, stops, and landmarks. It names distance_tool as an alternative but does not explicitly state exclusions or contrast with nearest_point_on_line_tool.

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