Skip to main content
Glama
mapbox

Mapbox MCP Server

Official

Optimize Multi-Stop Route

optimization_tool
Read-onlyIdempotent

Optimize visiting order for up to 12 waypoints, solving the Traveling Salesman Problem to minimize travel time. Supports custom start, end, and roundtrip options.

Instructions

Find the optimal (shortest by travel time) route through a set of 2-12 coordinates. Solves the Traveling Salesman Problem to determine the best visiting order. Supports options for starting point, ending point, and whether to return to start.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stepsNoWhether to include turn-by-turn instructions
sourceNoLocation to start the trip. "any" allows any coordinate, "first" forces the first coordinate as start.any
profileNoRouting profile to use for optimizationmapbox/driving
languageNoLanguage for instructions (if steps=true). ISO 639-1 code (e.g., "en", "es").
overviewNoDetail level of route geometrysimplified
roundtripNoWhether to return to the starting point. Set to false for one-way trips.
geometriesNoFormat for route geometrygeojson
annotationsNoAdditional metadata to include for each route segment
coordinatesYesArray of {longitude, latitude} coordinate pairs to optimize a route through. The V1 API supports 2-12 coordinates and returns the optimal visiting order.
destinationNoLocation to end the trip. "any" allows any coordinate, "last" forces the last coordinate as end.any

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesStatus code (e.g., "Ok" for success, error code otherwise)
tripsYesArray containing the optimized trip (typically 1 trip for all waypoints)
messageNoError message if code is not "Ok"
waypointsYesInput coordinates snapped to the road network in optimized order
Behavior3/5

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

Annotations already declare safe read-only behavior (readOnlyHint=true, idempotentHint=true, destructiveHint=false). The description adds the TSP solving and coordinate constraints but does not go beyond what annotations provide, so a score of 3 is appropriate.

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 sentences front-loaded with core purpose, TSP explanation, and options list. No wasted words, highly efficient.

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?

Given the tool has an output schema and high schema coverage, the description is nearly complete. It lacks some behavioral edge cases but is sufficient for an agent to understand usage.

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?

With 100% schema description coverage, the description adds little beyond schema. It notes support for starting/ending points and roundtrip, which maps to parameters, but does not compensate significantly.

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 clearly states the tool solves TSP to find the shortest route through coordinates, with explicit mention of 'shortest by travel time' and 'best visiting order.' It distinguishes itself from siblings like directions_tool by focusing on optimization rather than sequential directions.

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?

The description implies usage for optimizing multi-stop routes but does not explicitly state when to use this tool vs alternatives like directions_tool or matrix_tool. It mentions supported options but lacks exclusion criteria.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mapbox/mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server