Skip to main content
Glama

Plan routes for one or more drivers

plan_routes
Read-onlyIdempotent

Split up to 100 stops across up to 10 drivers from one depot and put each driver's stops in the best order on real roads (Great Britain and US), within a shift length including time at each stop. Each driver gets google_maps_links: the day as chained Google Maps links of up to 9 stops each, every link starting where the last one ended (the Maps app takes about 10 stops a route), so a driver opens the first and then the next; plus google_maps_link_all_stops, one link with every stop, for a desktop browser. Stops that do not fit or cannot be reached come back in unassigned with the reason. A driver over the daily driving limits (EU/UK 9 hours, US 11) gets driving_limit_warning; low bridges under 4.6 m near a driver's road come back as low_bridges (advisory). The map of each driver's stops, numbered in order, shows in the chat by itself (no road line: the Google Maps links are the route). Set render to true only when the user wants to keep or share the map: it returns a link, GeoJSON and KML, and update_map can change it later. A kept route map carries each driver's Google Maps links. Set driver_links to true when the drivers should tick stops off on their phones or the customers should be able to follow their delivery: each driver then gets driver_link (a page for the phone: the stops in order, done / no answer / rescheduled, a note or a photo) and each stop gets tracking_link to send to that customer (how many stops are ahead of them and when it was delivered, as the driver ticks stops off; it is not a live position on a map). The links work for 90 days. Set start_time (the clock time the drivers leave the depot, such as "09:00") when customers are told a timeframe: each stop then gets window (a two-hour slot around its expected arrival; window_minutes changes the width) and customer_message, a short message ready to paste into WhatsApp or a text, with the timeframe and, when driver_links is on, that customer's tracking link. Give from_name (the business) so the message and the tracking page say who the delivery is from. The message names no day: add "today" or the date yourself if the user wants it. Give each stop the customer's name so the message can greet them. The times are estimates from typical traffic, so say so.

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": {
      "depot": "<depot>"
    },
    "name": "plan_routes"
  }
}

Input Schema

NameRequiredDescriptionDefault
depotYesWhere the drivers start: an address or {lat, lng}.
stopsNoAddresses, or {id, name, address} / {id, name, lat, lng}. name labels the stop on the map and in the plan.
titleNoThe kept map's title when render is on, and the day's name on the drivers' pages.
renderNoAlso keep the map: a link to share with the drivers, GeoJSON and KML.
sourceNoInstead of typing rows: { sheet: "<Google Sheets link>", tab?: "Sites" } (shared with the InstaMaps service account, or viewable by anyone with the link), { file: "<Drive link to a CSV or Excel file>" }, or { run: "<run_id from an earlier answer>" }. Columns are found by their headers (id, name, address or its parts, lat/lng); name them if they aren't obvious (id_column, address_column, lat_column, lng_column; from_column and to_column for road distances). Rows with coordinates are used as they are.
driversNo
trafficNoweekday (default): road times with the area's measured weekday slowdown (DfT delay on local 'A' roads by council and on motorways in Great Britain; the Urban Mobility Report's Travel Time Index by US urban area). free_flow: empty roads.weekday
from_nameNoThe business the deliveries are from: named in customer_message and at the top of each tracking page.
start_timeNoThe clock time the drivers leave the depot, such as "09:00" or "8:30am". Each stop then gets window and customer_message.
shift_hoursNo
driver_linksNoAlso make a check-off page for each driver's phone (driver_link) and a tracking page for each stop's customer (tracking_link).
window_minutesNoHow wide each customer's timeframe is, in minutes (with start_time).
return_to_depotNo
service_minutesNoTime spent at each stop.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • addedInput schema / properties / driver_links
      Added value: +{
      +  "default": false,
      +  "description": "Also make a check-off page for each driver's phone (driver_link) and a tracking page for each stop's customer (tracking_link).",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / from_name
      Added value: +{
      +  "description": "The business the deliveries are from: named in customer_message and at the top of each tracking page.",
      +  "maxLength": 40,
      +  "type": "string"
      +}
    • addedInput schema / properties / start_time
      Added value: +{
      +  "description": "The clock time the drivers leave the depot, such as \"09:00\" or \"8:30am\". Each stop then gets window and customer_message.",
      +  "type": "string"
      +}
    • changedInput schema / properties / title / description
      Previous value: -"The kept map's title when render is on."New value: +"The kept map's title when render is on, and the day's name on the drivers' pages."
    • addedInput schema / properties / window_minutes
      Added value: +{
      +  "default": 120,
      +  "description": "How wide each customer's timeframe is, in minutes (with start_time).",
      +  "maximum": 480,
      +  "minimum": 30,
      +  "type": "integer"
      +}
  2. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Far beyond the annotations, it discloses concrete return artifacts (google_maps_links, google_maps_link_all_stops, unassigned with reasons, driving_limit_warning, low_bridges, driver_link, tracking_link, window, customer_message), plus the 90-day link lifetime and the caveat that times come from typical traffic. Remaining gaps are runtime/cost, behavior on unresolvable addresses, and the edge tension that render/driver_links produce persistent links while readOnlyHint=true; that does not rise to a contradiction since nothing described modifies or deletes existing data.

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?

Core purpose and limits are front-loaded in the first sentence, and the length is defensible for a 14-parameter planning tool with many conditional outputs. It is a single dense block of long run-on sentences, though, with some repetition about Google Maps link chaining, so scanning for a specific flag's guidance takes effort.

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?

With no output schema and a large nested input schema, the description carries the full disclosure burden and does so: it explains what each optional flag yields, how unassigned stops and warnings surface, and how links age out. An agent has enough to call this correctly and to narrate results to a user without opening the schema.

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 79% schema coverage the schema already documents most parameters, so the baseline applies. The description nonetheless adds real meaning for a subset: when to flip render and driver_links, the 'clock time ... such as "09:00"' format for start_time, that window_minutes changes the timeframe width, that from_name brands both the message and tracking page, and the delivery-limit context for traffic. It says nothing extra about drivers, shift_hours, service_minutes, return_to_depot, or the source sub-columns.

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 opens with a precise verb+resource+limits: 'Split up to 100 stops across up to 10 drivers from one depot and put each driver's stops in the best order on real roads'. It also names the scope (Great Britain and US), the shift constraint, and implicitly distinguishes itself from siblings like update_map and render_map by stating it returns an inline map and links rather than producing a kept map by default.

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?

Nearly every optional feature has an explicit use condition: 'Set render to true only when the user wants to keep or share the map', 'Set driver_links to true when the drivers should tick stops off on their phones or the customers should be able to follow their delivery', 'Set start_time ... when customers are told a timeframe'. It also directs follow-up work to update_map, so the agent knows when to stop and hand off.

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