Skip to main content
Glama

trip_generate

Generate origin-destination trip definitions for SUMO traffic simulation. Supports random trips with adjustable traffic levels or real OD data from CSV files using coordinate or zone mapping.

Instructions

[Step 3/5] Generate trip demand (trips.xml) for SUMO simulation.

Creates origin-destination trip definitions. This tool ONLY generates trips —
route assignment is done separately by route_generate().

Previous step: net_convert() to get .net.xml file.
Next step: route_generate() to assign routes to trips.

=== THREE MODES ===

1. RandomOD — Random trip generation:
   - trip_type: "RandomOD"
   - traffic_condition (REQUIRED): "light" | "medium" | "heavy"
     * light: ~20% of edge count (rural, off-peak)
     * medium: ~80% of edge count (typical urban)
     * heavy: ~150% of edge count (rush hour, dense urban)

2. RealOD-coordinate — Real OD from coordinate CSV:
   - trip_type: "RealOD", od_type: "coordinate"
   - od_data_file: Path to CSV file
   - Default columns: O_lon, O_lat, D_lon, D_lat, O_time_relative
   - Use column_mapping if your CSV has different column names

3. RealOD-zone — Real OD from zone CSV + shapefile:
   - trip_type: "RealOD", od_type: "zone"
   - od_data_file: Path to OD CSV file
   - zone_shp_file: Path to zone shapefile (.shp)
   - Default columns: h3_lv9_O, h3_lv9_D, O_time_relative
   - Default shapefile ID column: h3_indx
   - Use column_mapping to override any of these

=== COLUMN MAPPING ===
For non-standard CSV files, provide column_mapping to map standard names to actual column names.

Coordinate mode mapping keys:
  "O_lon", "O_lat", "D_lon", "D_lat", "O_time_relative"
Zone mode mapping keys:
  "zone_O", "zone_D", "O_time_relative", "zone_id_column"

Example: {"O_lon": "pickup_lng", "O_lat": "pickup_lat", "D_lon": "dropoff_lng", "D_lat": "dropoff_lat", "O_time_relative": "start_sec"}

=== RETURNS ===
- trip_file: Path to generated .trips.xml file (pass to route_generate)
- trip_count: Number of trips generated

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
od_typeNo
net_fileYes
trip_typeYes
output_dirNooutput/trips
od_data_fileNo
zone_shp_fileNo
column_mappingNo
traffic_conditionNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It transparently describes what the tool does (generates trips, not routes), mentions column mapping, and lists return values (trip_file, trip_count). It could be improved by noting potential errors or performance considerations, but it is generally clear.

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 relatively long but well-structured with sections (modes, column mapping, returns). It is front-loaded with the purpose and then goes into details. It could be slightly more concise, but the structure aids readability.

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

Completeness4/5

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

Given 8 parameters (2 required) and an output schema, the description is fairly complete. It explains modes, column mapping, return values, and workflow steps. It could include default values for output_dir or clarify that net_file must come from net_convert, but overall it is comprehensive.

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

Parameters4/5

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

Schema description coverage is 0%, but the tool description explains 6 out of 8 parameters in detail: traffic_condition with values, column_mapping with examples, od_type, trip_type, od_data_file, zone_shp_file. It adds meaning beyond the schema by explaining default columns and mapping keys. However, net_file and output_dir are not explained, and output_dir's default is only in the schema.

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 'Generate trip demand (trips.xml) for SUMO simulation' and distinguishes from sibling tool route_generate by explaining that route assignment is done separately. It also breaks down three distinct modes with specific use cases, making the purpose unambiguous.

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 explicit context: previous step net_convert, next step route_generate. It explains when to use each of the three modes (RandomOD, RealOD-coordinate, RealOD-zone). However, it does not explicitly state when NOT to use this tool or mention alternatives beyond route_generate.

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