Route Plan
route_planOrder up to 12 stops into the shortest single-vehicle route on your distance matrix. FREE.
Typical input {"stops": [{"id": "depot"}, {"id": "A"}, {"id": "B"}], "matrix": [[0, 5, 9], [5, 0, 4], [9, 4, 0]]} returns {"routes": [{"vehicle": 0, "stops": [...], "distance": 18.0}], "total_distance": 18.0, "solver_status": "FEASIBLE", "note": "..."}. The matrix is in your units (km, minutes, cost) and must be square with the depot at index 0 unless depot says otherwise; optional demand per stop with vehicle_capacity turns it into a capacity check. Use for one driver's day or a courier's loop. Not for several vehicles or time windows: use route_plan_fleet. Not a map service: bring your own distances or call distance_matrix_haversine for straight-line values. Errors: on invalid, missing, or malformed input this tool never raises a protocol error — it returns {"error": ""} (for example {"error": "stops must be a list of stop objects, depot first"}). Every call is read-only and idempotent, so after correcting the input it is always safe to retry.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| depot | No | index of the depot in stops (default 0). | |
| stops | Yes | list of stop objects, depot first: id, optional demand. | |
| matrix | Yes | square distance (or time) matrix, row i column j = cost from stop i to stop j. | |
| time_limit_s | No | solver time budget in seconds (default 3, max 15). | |
| vehicle_capacity | No | optional capacity in the units of demand (0 = unlimited). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||