Skip to main content
Glama

osm_extract

Download OpenStreetMap road network data for a geographic area using bbox, city+radius, OD data file, or zone shapefile. Outputs .osm file for traffic simulation.

Instructions

[Step 1/5] Extract OpenStreetMap (OSM) road network data for a given area.

This is the FIRST step in the simulation pipeline. It downloads or extracts
raw OSM data (.osm file) for the specified geographic area.

Next step: Use net_convert() to convert the .osm file to SUMO .net.xml format.

=== AREA SPECIFICATION (priority order) ===
1. bbox: Direct coordinates [west, south, east, north]
   Example: [127.015, 37.490, 127.040, 37.506]
2. od_data_file: Auto-compute bbox from OD CSV coordinate columns
   (use column_mapping if columns are not named O_lon, O_lat, D_lon, D_lat)
3. zone_shp_file: Auto-compute bbox from shapefile geometry bounds
4. city + radius: Geocode city name and use radius in KILOMETERS (not meters!)
   Example: city="Gangnam Station", radius=1.5

=== PARAMETERS ===
- city_en (REQUIRED): English name for file naming. Example: "gangnam", "manhattan_midtown"
- bbox: [west, south, east, north] bounding box coordinates
- city: City/location name for geocoding (e.g., "강남역", "Times Square")
- radius: Radius in km (used with city parameter)
- od_data_file: Path to OD CSV file (bbox auto-computed from coordinate ranges)
- zone_shp_file: Path to zone shapefile (bbox auto-computed from geometry)
- column_mapping: Column name mapping for non-standard OD CSV files.
  Keys are standard names, values are actual column names in the CSV.
  Example: {"O_lon": "pickup_lng", "O_lat": "pickup_lat", "D_lon": "dropoff_lng", "D_lat": "dropoff_lat"}

=== PIPELINE CONTEXT ===
RandomOD:     osm_extract(bbox/city+radius) → net_convert → trip_generate → route_generate → sumo_runner
RealOD-coord: osm_extract(od_data_file, column_mapping) → net_convert → trip_generate → route_generate → sumo_runner
RealOD-zone:  osm_extract(zone_shp_file) → net_convert → trip_generate → route_generate → sumo_runner

=== RETURNS ===
- osm_file: Path to extracted .osm file (pass to net_convert)
- bbox: Computed bounding box (pass to net_convert for boundary trimming)
- tag: File naming tag derived from city_en

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bboxNo
cityNo
radiusNo
city_enYes
output_dirNooutput/networks
od_data_fileNo
zone_shp_fileNo
column_mappingNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description bears full burden. It discloses that the tool downloads/extracts raw OSM data, returns osm_file, bbox, and tag, and describes the pipeline. It doesn't mention destructive actions, authentication, or rate limits, but these are less relevant for a simulation data extraction tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is slightly verbose with some redundancy (pipeline context appears twice), but it is well-structured with sections and front-loaded with the step number and purpose. Every section adds value, though some trimming could improve conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (8 parameters, nested objects, multiple area specification methods), the description is thorough. It explains return values, pipeline context, examples, and parameter dependencies. The output schema is provided, so return values are clear.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, but the description adds extensive meaning: it explains all area specification methods, required/optional parameters, usage examples, and purpose of each parameter. This compensates fully for the lack of schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it extracts OSM road network data for a given area and is the first step in the simulation pipeline. It distinguishes itself from siblings by referencing next steps like net_convert and providing a pipeline context, making the purpose specific and differentiated.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides a detailed priority order for area specification (bbox, od_data_file, zone_shp_file, city+radius) with examples, indicating when each method is appropriate. While it doesn't explicitly state when not to use the tool, the context of being the first pipeline step implies usage conditions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/urban-ai-institute/kra35-prismx-agentsumo'

If you have feedback or need assistance with the MCP directory API, please join our Discord server