search_along_route
Call this tool when the user wants to find places, businesses, or points of interest along a travel route (e.g., "gas stations on my way to Tahoe", "coffee shops between SF and San Jose"). Calling this tool incurs higher cost than search_places, so use search_places instead when searching near a single location rather than along a route.
Input Requirements (CRITICAL):
text_query(string - MANDATORY): A natural language description of what to search for along the route.Examples:
'ev chargers','coffee','vegetarian restaurants','rest stops'.
Route specification (MANDATORY - provide exactly ONE of the following):
retrieval_token(string): Theretrieval_tokenreturned by a priorcompute_routescall for aDRIVEroute. Prefer this whenever the route was already computed. The token is valid for 10 minutes.route_endpoints(object): The route'soriginanddestination. Each must be provided using one ofaddress,lat_lng, orplace_id.Example:
{"route_endpoints": {"origin": {"address": "San Francisco, CA"}, "destination": {"address": "Lake Tahoe, CA"}}}
encoded_polyline(string): An encoded polyline representing aDRIVEroute.
travel_mode(enum - OPTIONAL):DRIVE(default),WALK, orBICYCLE.WALKandBICYCLEare only supported withroute_endpoints.TRANSITis not supported.routing_preference(enum - OPTIONAL):ROUTING_PREFERENCE_TRAFFIC_UNAWARE(default): computes the route and detours without live traffic. Lowest latency.ROUTING_PREFERENCE_TRAFFIC_AWARE_OPTIMAL: uses live traffic conditions when available. Not supported forWALKorBICYCLE. Set this ONLY when the user asks about traffic, congestion, or traffic-adjusted detour times. It incurs higher latency.
include_extended_details(boolean - OPTIONAL): Set totrueonly when the request requires qualitative review insights, specific menu items or offerings, atmosphere, visitor tips or busyness, EV charger availability, gas prices, or other rich qualitative details. Defaults tofalse. Enabling it may increase latency.language_code(string - OPTIONAL): The language for the results summary and place details, e.g.,en,ja,en-US. Defaults toen-US.region_code(string - OPTIONAL): The Unicode CLDR region code of the user, e.g.,US,CA.
Instructions for Tool Call:
Each result includes a
detour_summary(when available) describing the extra distance (localized_detour_distance) and, unless the route was given asencoded_polyline, the extra time (detour_duration) incurred by stopping at that place. Use it to compare options.The response
summarymay contain zero-based citations (e.g., "[0]") referencing entries inresults.The grounded output must be attributed to the source using the
attributionfield of eachresults[].placewhen available.
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": {
"textQuery": "<textQuery>"
},
"name": "search_along_route"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| textQuery | Yes | Required. Natural language search query (e.g., "ev chargers", "coffee"). | |
| regionCode | No | Optional. Country/region code (CLDR) of location (e.g., "US"). | |
| travelMode | No | Optional. Specifies the travel mode used to compute the route and the detours. Defaults to `DRIVE`. `WALK` and `BICYCLE` are only supported with `route_endpoints`. `TRANSIT` is not supported. | |
| languageCode | No | Optional. The language for summary and place details. Defaults to "en-US". | |
| retrievalToken | No | A retrieval token returned from a prior ComputeRoutes call representing the route. Only one of the following fields should be set: this field, encodedPolyline, routeEndpoints. | |
| routeEndpoints | No | Explicit route endpoints (origin and destination). Only one of the following fields should be set: this field, encodedPolyline, retrievalToken. | |
| encodedPolyline | No | An encoded polyline string representing the route. See https://developers.google.com/maps/documentation/utilities/polylinealgorithm. Only one of the following fields should be set: this field, retrievalToken, routeEndpoints. | |
| routingPreference | No | Optional. Optional routing preference specifying how traffic data is used. Defaults to TRAFFIC_UNAWARE. | |
| includeExtendedDetails | No | Optional. Includes extended place details in the response. Set this field to `true` when the user request requires rich qualitative insights, real-time dynamics, or specialized entity attributes: - Qualitative reviews, customer sentiment, and feedback. - Specific offerings like menu items, dishes, food specialties, beverages, or business highlights. - Qualitative atmosphere, interior decor, aesthetic, ambience, or mood. - Real-time data and specialized facility specs, visitor policies/tips, wait times. Leave `false` (default) for standard discovery searches (e.g., cuisines, store types), location/address lookups, contact info, operating hours, and standard metadata/amenities. Enabling this field may incur higher latency. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| results | No | Output only. The ranked list of search results found along the route. | |
| summary | No | Output only. Natural language summary of search results and detour trade-offs. May contain zero-based citations (e.g. "[0]", "[1]") referencing the corresponding entries in the `results` list. | |
| contentToken | No | Output only. An encrypted token that encapsulates the search context and can be passed to Google Maps visual rendering services, SDKs, or the Maps Agentic UI Toolkit (A2UI) to display interactive UI components for the returned search results. |