Route Editing Tour
Use when
Use after generation/import to add, remove, split, merge, reverse, avoid, reroute, extend, undo, or redo route/tour content.
Do not use when
Do not use for a new independent route with no relationship to an existing route workspace.
Prefer the smallest edit that satisfies the request.
Workflow
- Identify the active route/tour and target span. In a provider-managed chat, call the matching edit/analysis tool directly with omitted identifiers so it can infer the visitor's persisted active route; do not list sessions. Only when a direct tool explicitly reports ambiguous continuity may you call
route.get_sessiononce and use its compact active-route/lineage result; never poll it. - For add-stop/road-avoid edits, isolate the span before changing it.
- Use CH-less edits for short local reroutes and multi-point generation for long or ingredient-heavy edits.
- After edits, summarize new route alias/id, distance delta, changed span, and available undo.
- Use
route.undo_tourandroute.redo_tourexactly once and only for explicit undo/redo requests. A successful change or structuredstatus: no_opwithchanged: falseis terminal; report the returned active route and do not poll session state or repeat the mutation.
Use these exact mutation paths:
- Avoid a named road or distance span:
route.analyze_osrm_segments->route.plan_avoidance_edit->route.apply_avoidance_edit. - Add a generated conversational leg:
route.geocode_locationswhen the destination is text, thenroute.extend_tour. - Merge, split, keep/remove a window, append, or prepend stored routes:
route.edit_tour. - Reverse a route legally:
route.reverse_route. Omit identifiers in a provider-managed chat so the tool resolves the persisted active/latest route. Cached engine routes use the engine's legal reverse; locally composed or imported routes rebuild the reversed stored shape through Route Intelligence. Both paths create a lineage revision, preserve attached POIs at reversed route positions, and must remain within the server's distance-drift safety envelope. If that invariant fails, report the failure and keep the source route active. - Undo/redo:
route.undo_tourorroute.redo_tour.
Do not regenerate the entire route with route.generate_routes when a local revision tool can preserve the current route and lineage.
Keep generated tours as new versions with lineage rather than overwriting hidden state.
Postconditions
- The new route version preserves lineage and reports changed spans and distance delta.
- The active route alias/id is explicit.
- Undo availability is reported without performing undo unless requested.
- A reverse never silently activates a route whose distance drifted beyond the legal-reverse safety envelope.