feat: directions_tool route selection elicitation - #239
Merged
mattpodwysocki merged 2 commits intoJul 30, 2026
Conversation
Directions routes have no stable ID across separate API calls, unlike search results (mapbox_id), so the chosen route is threaded through the self-fetch ref as a positional selectedRouteIndex, with a graceful fallback to routes[0] if it's out of range on re-fetch. Also corrects docs/elicitations.md, which described a two-stage directions_tool flow and automatic client-capability detection that were never actually implemented. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
6 tasks
Valiunia
previously approved these changes
Jul 30, 2026
…-selection-elicitation # Conflicts: # CHANGELOG.md # README.md
Valiunia
approved these changes
Jul 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
search_and_geocode_tooluses for disambiguation.directions_toolcallsserver.elicitInput(...)presenting each option's duration, distance, primary roads, traffic, and incident count, and returns only the selected route.mapbox_id), so the selection is threaded through the self-fetch ref as a positionalselectedRouteIndex, with a graceful fallback toroutes[0]if it's out of range on re-fetch.docs/elicitations.md, which (since Add geocoding disambiguation with elicitations #98) described a two-stagedirections_toolflow and automatic client-capability detection that were never actually implemented.Test plan
npx tsc --noEmit -p tsconfig.src.json— cleannpx eslint— 0 errors (pre-existing unrelated warnings only)DirectionsTool.test.tscovering: elicitation triggers at 2+ routes, doesn't trigger at 1, filters to selected route + threadsselectedRouteIndex, falls back on decline/error/unsupported/no-servermapAppHtml.script.test.tscovering the client-side self-fetch: draws the route atselectedRouteIndex, falls back to first route when out of range, never fetches when the index isn't a valid non-negative integer🤖 Generated with Claude Code