plan_errands
Order a handful of errands against a hard arrival time, and say honestly whether they fit. This is the "pick up a prescription, get petrol, and be at the school by quarter past three" tool. Give origin, destination (+ destination_name), arrive_by (RFC 3339 with an offset: convert "quarter past three" yourself), optional depart_at, and 1 to 5 errands. Each errand is EITHER a category (a kind of place: "pharmacy", "fuel", "supermarket", or a colloquial phrase the server normalises; use list_place_categories for the vocabulary) OR a place {lat, lon} the driver already knows ("the school", "the nursery"). Resolve a named place with geocode first and pass the coordinate: never invent one. Optional dwell_minutes per errand (default 5). The server chooses the order and the actual shops, exhaustively, over engine-computed travel times -- do NOT attempt the ordering or the arithmetic yourself. IMPORTANT: feasible: false is an ANSWER, not an error to retry. It names the errand that costs the most (blocking_errand), says how late the whole chain would be (over_by_s), and returns the stops of the chain that DOES fit with dropped naming what had to go. Tell the driver what to drop. Every stop is a real indexed place carrying its id: never mention a shop the answer did not return. hours is "open_on_the_tag" (the map's tag covers your arrival, which is evidence and not a promise) or "unknown" (most places carry no hours at all); a place the tag proves shut is never proposed. ALWAYS show usage_note: this is planned before setting off or by a passenger, never at the wheel. Requires the MapMap gateway.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| origin | Yes | Where the driver sets off from. | |
| errands | Yes | The errands, in any order: the answer decides the order. One to five. | |
| arrive_by | Yes | The hard arrival time, RFC 3339 with an offset ("2026-09-21T15:15:00+01:00"). Convert "quarter past three" to an absolute instant in the driver's own offset before calling. | |
| depart_at | No | When they set off, RFC 3339. Defaults to now. | |
| destination | Yes | Where they have to be by `arrive_by`. | |
| destination_name | No | What to call the destination in the answer ("the school"). | |
| max_detour_minutes | No | How far off the direct route a candidate place may sit, as a detour in minutes (default 12, at most 45). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| stops | Yes | The stops, in visit order. On an infeasible answer these are the stops of the reduced plan, the one that DOES fit. | |
| reason | No | The same cause in plain language, for the driver. | |
| arrival | No | When the plan arrives, RFC 3339. Present whenever there is a plan, including the reduced plan on an infeasible answer. | |
| dropped | Yes | Errands that had to be dropped for the plan to fit. Empty when feasible. | |
| slack_s | No | Spare seconds before the deadline. | |
| feasible | Yes | **Whether every errand fits before the deadline.** False is an ANSWER, not an error: report `reason`, the errand named in `blocking_errand`, and what `dropped` says has to go. | |
| arrive_by | Yes | The deadline, echoed. | |
| departure | Yes | When the driver sets off, RFC 3339. | |
| over_by_s | No | How late the whole chain would be, seconds. | |
| usage_note | Yes | **Always present.** Why this is planned stationary rather than at the wheel. Show it. | |
| attribution | No | Credit owed for the place data, when the answer used the index. | |
| reason_code | No | Machine token for why the chain does not fit: "deadline_missed", "destination_unreachable_in_time", "no_candidates_in_corridor", "all_candidates_closed" or "unroutable". | |
| corridor_note | Yes | **Always present.** What the corridor search did and did not look at. An empty answer is a statement about this index and this corridor, never about what exists on the ground. | |
| failed_errand | No | The errand a "no_candidates_in_corridor" or "all_candidates_closed" answer is about. | |
| total_drive_s | No | Total driving time, seconds. | |
| total_dwell_s | No | Total time out of the car, seconds. | |
| blocking_errand | No | The errand that costs the most time, when the deadline is missed. | |
| verification_note | Yes | **Always present.** That every stop is an indexed place or a supplied coordinate, never a generated one. | |
| geometry_polyline6 | No | The planned journey as an encoded polyline6. | |
| opening_hours_note | Yes | **Always present.** How opening hours were used, and how little of the map carries them. |