get_edge_ids_from_road_name_tool
Convert a human-readable road name to SUMO edge IDs using a network file, enabling SQL queries on traffic metrics by road name.
Instructions
Convert road name to SUMO edge IDs using edge.getName().
IMPORTANT: Use this when user asks questions with road names (e.g., "What is the density of Teheran-ro?")
This tool maps human-readable road names to SUMO's technical edge IDs,
enabling SQL queries based on road names.
Args:
road_name: Road name (e.g., "테헤란로", "강남대로", "9th Avenue")
net_file: Network file path used in simulation.
When working with DB data, get this from:
SELECT net_file FROM simulations WHERE simulation_id = '<your_sim_id>'
Returns:
List[str]: List of edge IDs matching the road name
Example workflow:
1. User asks: "What is the density of Teheran-ro?"
2. Get net_file from DB (if using DB data):
read_query("SELECT net_file FROM simulations WHERE simulation_id = 'baseline'")
→ "/path/to/network.net.xml"
3. Convert road name to edge IDs:
get_edge_ids_from_road_name_tool(
road_name="테헤란로",
net_file="/path/to/network.net.xml" # Use actual path from step 2
)
→ ["375049565#11", "375049565#12", "375049565#13", ...]
4. Use in SQL query:
read_query("SELECT AVG(density) FROM edge_metrics WHERE edge_id IN ('375049565#11', '375049565#12', ...)")
5. Present results with road name (not edge IDs)
Note:
- Returns all edge segments for the given road name
- Raises ValueError if road name not found
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| net_file | Yes | ||
| road_name | Yes |