Skip to main content
Glama

Optimize stop order

optimize_route
Read-only

Optimizes the visiting order of a set of stops to minimize total travel distance and time, returning a complete itinerary. Supports car, foot, or bike travel and optional roundtrip routing.

Instructions

Finds the best order to visit a set of stops (traveling-salesman optimization) and returns the optimized itinerary with total distance and time. With roundtrip (default) the tour returns to the first stop; without it the first stop is the start and the last stop the end.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stopsYes
profileYesTravel mode: on foot, by car or by bicycle
languageNoLanguage for resolved place labels, default "en"
roundtripNoReturn to the first stop at the end, default true
Behavior3/5

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

The annotation readOnlyHint=true already indicates the tool does not modify state, so the description carries a lower burden. The description adds context about the roundtrip behavior, which is useful. However, it doesn't disclose constraints like the max of 12 stops or that stops must be resolvable, which are important for expected behavior beyond the schema.

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 description is two sentences long, with the first sentence covering the core purpose and the second explaining the roundtrip option. It is front-loaded and efficient, though the second sentence could be split for clarity.

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's moderate complexity (4 parameters, no output schema, no nested objects), the description covers the optimization problem, return format, and roundtrip behavior. It lacks detail on error cases or place resolution, but the schema handles stop validation. The output is not described but it's a standard optimized route format, so completeness is adequate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 75%, so the description adds value by explaining the roundtrip parameter's effect on the itinerary structure. This goes beyond the schema's boolean description, clarifying that with roundtrip the tour returns to the first stop, and without it the first stop is the start and the last stop is the end.

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 finds the best order to visit stops (traveling-salesman optimization) and returns an optimized itinerary with total distance and time. This distinguishes it from siblings like route (simple point-to-point routing) and route_matrix (all-pairs distances).

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 description explains the difference between roundtrip and non-roundtrip modes, which helps the agent decide when to use each. However, it does not explicitly say when to use this tool versus alternatives like route_matrix or suggest_meeting_point, leaving the agent to infer based on the purpose statement alone.

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/ni-c/osm-mcp'

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