validate_od_coordinates_tool
Validate coordinates against a SUMO network to check if they are within the network and find the nearest edge, enabling verification of reachable destinations before proposing them.
Instructions
Validate a list of coordinates against the SUMO network.
Use this BEFORE generating flows to check which coordinates are within the network
and find the nearest edges. Essential for agentic OD planning — lets you verify
destinations are reachable before proposing them to the user.
Args:
net_file: SUMO network file path (.net.xml)
coordinates: List of coordinate dicts, each with:
- lat (float): Latitude (WGS84)
- lon (float): Longitude (WGS84)
- label (str, optional): Human-readable label (e.g., "Lincoln Tunnel")
search_radius: Search radius in km for nearest edge (default: 0.5)
Returns:
Dict with:
- network_bbox: [min_lon, min_lat, max_lon, max_lat]
- results: List of validation results per coordinate:
- label, lat, lon
- in_network: bool
- nearest_edge: edge ID (or null)
- distance_m: distance to nearest edge in meters (or null)
- status: "ok" | "out_of_network" | "no_edge_found"
Example:
validate_od_coordinates_tool(
net_file="manhattan.net.xml",
coordinates=[
{"lat": 40.7505, "lon": -73.9934, "label": "MSG"},
{"lat": 40.7425, "lon": -74.0099, "label": "Holland Tunnel"},
{"lat": 40.7060, "lon": -73.9969, "label": "Brooklyn Bridge"}
]
)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| net_file | Yes | ||
| coordinates | Yes | ||
| search_radius | No |