Skip to main content
Glama

Fleet Route Optimizer

Optimize delivery routes

optimize_routes
Read-only

Plan routes for one or more vehicles from one depot and return, per vehicle, the stop order with arrival times and load so far, plus stops that could not be served, totals, Google Maps links and warnings. Uses real road driving times. Solves take 10-60 s (more when many addresses must be looked up). Pass either example or the fields below. If the result has status 'running', call get_route_result with its job_id. Minimal example: {"depot": {"address": "1600 Pennsylvania Ave NW, Washington, DC 20500"}, "stops": [{"id": "Ana", "address": "..."}, {"id": "Bob", "lat": 38.9, "lon": -77.03, "window_open": "09:00", "window_close": "12:00", "service_minutes": 10}], "vehicles": 2}. Omitted: capacity = unlimited, no time windows, 1 vehicle, stops are dropped only when they cannot be served at all. Call get_route_example for complete, realistic inputs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
depotNoWhere every vehicle starts and ends. Needs an address or lat+lon.
stopsNoThe places to visit (not the depot). Each needs an address or lat+lon.
countryNoWhich geocoder reads the addresses: US (US Census, then OpenStreetMap) or OTHER (OpenStreetMap). Default US.
exampleNoSolve this built-in example instead of passing the fields below.
vehiclesNoEither a number of identical vehicles (unlimited capacity), or one object per vehicle.
parametersNoOptional engine settings: SearchParametersTimeLimit (seconds, default 30, max 60), NoImprovementSeconds (20), RouteTimeLimit (minutes, default 1440), DroppedOrderCost (100000 = serve every stop that can be served), MinuteCost (1), LatePenaltyPerMinute (0 = windows are hard), MaxWaitMinutes (1440), MinimumDriveTime (5).
wait_secondsNoHow long to wait for the solve inside this call (default 25).
previous_routesNoRe-optimize from existing routes: one list of stop ids (or 1-based stop numbers) per vehicle, in visiting order. The solver starts from these and improves them; new stops are fitted in.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already mark this readOnly/non-destructive/openWorld, and the description adds substantial context beyond that: solves take 10-60s and longer with many geocodes, real road driving times are used, and the defaults for omitted fields (unlimited capacity, no time windows, 1 vehicle, drop-only-when-unservable) are spelled out. The async 'running' status contract is disclosed, which annotations cannot convey.

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?

Front-loaded with the output contract and solve-time expectations, then defaults, then the async fallback. The embedded JSON example is dense but earns its place by demonstrating the required nesting; the sentence count is proportionate to an 8-parameter nested schema.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, so the description carries the return-value burden and does so fully: stop order, arrival times, load so far, unserved stops, totals, Maps links, warnings. Combined with solve-time and async guidance, an agent has everything needed to call and interpret this tool.

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 coverage is 100%, so the baseline is 3; the description goes further by summarizing the defaults applied when fields are omitted and by supplying a minimal worked example that shows the nesting of depot/stops/vehicles. It does not explain the more advanced knobs (capacity2/3, previous_routes, parameters), so it stops short of a 5.

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 concrete verb and resource ('Plan routes for one or more vehicles from one depot') and specifies the output shape per vehicle, so the agent knows exactly what the tool produces. It is clearly distinguishable from the sibling helpers get_route_example and get_route_result.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit routing logic is given: pass either `example` or the fields below, call get_route_example for complete realistic inputs, and if the result has status 'running' call get_route_result with its job_id. The async handoff and the alternative-sourcing paths are both named, leaving nothing to inference.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources