solve_route

The solve_route tool solves a simple best-path route between a start and end location, with optional intermediate stops and a chosen travel mode such as driving, walking, or trucking.


Tool Name

solve_route


Tool Alias

Solve Route


Objective

Compute a single best-path route between a start and end location—optionally with ordered intermediate stops and a configured travel mode—against an ArcGIS Network Analysis Server route layer.


Description

solve_route provides an interface for performing a simple route-solving operation using the Solve Route API of an ArcGIS Network Analysis Server route layer. The input schema requires a start and end location, plus an optional stops array of intermediate points and an optional travelMode string.

Stops are visited in the given order

The optional stops array is visited in the exact order providedsolve_route does not reorder stops. If the client wants the optimal stop sequence to be computed for them, that is a different operation; see When not to use.

Spatial reference

Input and output spatial references are controlled separately:

  • inWkid — the spatial reference of the supplied start, end, and stops points.
  • outWkid — the spatial reference of the returned route geometry.

Both default to 4326 (WGS84). Use outWkid when the route geometry needs to align with a map in a different projection—for example, 3857 for Web Mercator.

Travel mode

The valid travel-mode strings depend on the route layer's configuration. For the layer this tool is wired to, the supported values are:

  • Driving Time
  • Driving Distance
  • Trucking Time
  • Trucking Distance
  • Walking Time
  • Walking Distance
  • Rural Driving Time
  • Rural Driving Distance

Note: travel mode strings are case-sensitive.

Follow these rules when deciding which travel mode (if any) to send:

  • No mention of travel? Do not provide travelMode. Let the route layer's default travel mode take precedence.
  • Client says "fastest with no mention of mode, or with "driving"? Use the mode closest to Driving Time.
  • Client says "fastest with "walking"? Use the mode closest to Walking Time.
  • Client says "shortest" or "closest with no mention of mode, or with "driving"? Use the mode closest to Driving Distance.
  • Client says "shortest" or "closest with "walking"? Use the mode closest to Walking Distance.
  • Otherwise, choose the most appropriate value from the supported list above.

Output

The output schema includes:

  • The route geometry—an Esri polyline representing the path.
  • A list of step-by-step directions for navigating the route.
  • The total distance and duration, with their units.

Important: read the unit fields, do not assume

The output durationUnits and distanceUnits come from the route layer's Network Dataset configuration (directionsTimeAttribute and directionsLengthUnits), not from the travel mode. Always read these unit fields rather than assuming miles/minutes—the same travel mode can return different units on different layers.

Tip Simpler requests with a limited number of stops work best.

When to use

  • The client wants to solve a simple route problem with a start, an end, optionally a few intermediate stops, and a common travel mode such as driving or walking.

When not to use

  • The client needs to solve a more specialized routing problem—service area (isochrone) calculations, closest facility, origin-destination cost matrix, or fleet routing.
  • The client explicitly wants the route optimized, allowing the tool to reorder stops to find the optimal sequence. That is a separate, more computationally expensive operation.
  • The client needs to provide an input or output spatial reference using wkt. solve_route accepts WKID-based spatial references only.
  • The client needs bulk operations or job submission. solve_route is intended for single, synchronous route-solving requests.

Schema

The full JSON Schema definitions for the input parameters accepted by solve_route and the output payload it returns are provided as separate files alongside this document.

Input schema

The input schema describes the required start and end points, the optional ordered stops array, the optional travelMode string, and the input/output spatial references (inWkid, outWkid, both default 4326).

Download or view SolveRouteToolInputSchema.json

Output schema

The output schema describes the response object: the route geometry (Esri polyline), a step-by-step directions array, and the total distance/duration with their corresponding distanceUnits/durationUnits derived from the Network Dataset configuration.

Download or view SolveRouteToolOutputSchema.json


Sample prompts to test the tool

Send any of the prompts below to your MCP-compatible AI client to verify that solve_route is working correctly. The prompts are grouped to exercise different inputs and behaviors—from a basic two-point route to each travel mode, ordered intermediate stops, raw WGS84 coordinates, and graceful handling of out-of-coverage requests.

Basic point-to-point routes

  • Use the route solver to get turn-by-turn directions and the exact distance and travel time from the Empire State Building, New York to Grand Central Terminal, New York.
  • Call the routing tool to find the fastest driving route from Los Angeles City Hall to LAX airport—I need the total duration in minutes and the step-by-step directions.
  • Use the route solver to calculate the shortest driving distance in miles between the White House, Washington DC and the Lincoln Memorial, Washington DC. Show me every direction step.

Travel-mode variations

  • Use the routing service to solve a Walking Time route from Millennium Park, Chicago to the Art Institute of Chicago. Return the exact walking duration and all direction steps.
  • Call the route solver with Walking Distance mode from Times Square, New York to Central Park, New York. Give me the precise distance and turn-by-turn instructions.
  • Use the routing tool with Trucking Time mode to get directions and total travel time from the Port of Los Angeles to 1000 S Alameda St, Los Angeles, CA.
  • Call the route solver using Trucking Distance mode from Dallas, TX to Houston, TX. Return the total truck route distance and all direction steps.
  • Use the routing service with Rural Driving Time mode to solve a route from Jackson, Wyoming to the south entrance of Yellowstone National Park. Give me the duration and directions.

Multi-stop routes

  • Use the route solver to plan a Driving Time route from San Francisco, CA to Los Angeles, CA with intermediate stops at San Jose, CA and Santa Barbara, CA. Return the total distance, total duration, and every direction step.
  • Call the routing tool to solve a Driving Distance route starting at 350 Fifth Avenue, New York, stopping at 30 Rockefeller Plaza, New York and then 1 Times Square, New York, ending at JFK Airport, New York. Give me the full step-by-step directions and total mileage.
  • Use the route solver with Walking Time mode from the Lincoln Memorial, Washington DC through the Washington Monument and the National Mall, ending at the US Capitol. Return the exact walking time and all navigation steps.

Using coordinates directly

  • Call the route solver with these WGS84 coordinates—start: x: -73.9857, y: 40.7484 (Empire State Building), end: x: -73.9654, y: 40.7829 (Central Park). Use Driving Time mode and return the duration and all direction steps.
  • Use the routing service to solve a Walking Distance route from x: -87.6298, y: 41.8781 to x: -87.6233, y: 41.8827 in Chicago. Give me the precise distance and turn-by-turn directions.

Out-of-coverage cases

  • Use the route solver to get turn-by-turn directions and exact travel time from 10 Downing Street, London to Buckingham Palace, London.
  • Call the routing service to calculate the exact Driving Time route from the Taj Mahal, Agra to New Delhi Railway Station, India. Return the full duration and turn-by-turn instructions.