Skip to main content
Glama

flow_generation_tool

Generates SUMO traffic flows between locations using place names or coordinates, with rate-based or total vehicle count options.

Instructions

Generate a SUMO flow from source to destination.

Two ways to specify locations:
1. Place names (source/dest) — uses geocoding to find coordinates
2. Direct coordinates (source_lat/lon, dest_lat/lon) — skips geocoding.
   Use this when coordinates are already known (e.g., from map O/D selection).

Two ways to specify vehicle count (exactly one required):
1. vehs_per_hour — rate-based generation (SUMO <flow vehsPerHour="N">)
2. number — total vehicle count over [begin,end] (SUMO <flow number="N">)

Safety parameters applied: departLane="free", departPos="random_free", departSpeed="random"

IMPORTANT: When calling multiple times for multi-OD scenarios, pass the previous call's
route_file output as the next call's route_file input to accumulate all flows in one file.

Args:
    route_file: Route file path (pass previous output for chained calls)
    net_file: Network file path
    source: Source location place name (e.g., "Madison Square Garden")
    dest: Destination location place name (e.g., "Lincoln Tunnel")
    begin: Start time in seconds (default: 0.0)
    end: End time in seconds (default: 3600.0)
    vehs_per_hour: Vehicles per hour — mutually exclusive with number
    number: Total vehicle count — mutually exclusive with vehs_per_hour
    flow_id: Flow ID (auto-generated if None)
    output_dir: Output directory for results
    use_geocoding: Use geocoding for place name resolution (default: True)
    search_radius: Search radius in km for nearest edge (default: 0.3)
    source_lat: Source latitude (WGS84) — use with source_lon for coordinate mode
    source_lon: Source longitude (WGS84) — use with source_lat for coordinate mode
    dest_lat: Destination latitude (WGS84) — use with dest_lon for coordinate mode
    dest_lon: Destination longitude (WGS84) — use with dest_lat for coordinate mode

Examples:
    Place name mode (geocoding):
    flow_generation_tool(route_file="r.rou.xml", net_file="n.net.xml",
        source="Madison Square Garden", dest="Lincoln Tunnel",
        begin=0, end=1800, vehs_per_hour=260)

    Coordinate mode (from map selection):
    flow_generation_tool(route_file="r.rou.xml", net_file="n.net.xml",
        source_lat=40.7505, source_lon=-73.9934,
        dest_lat=40.7580, dest_lon=-73.9855,
        begin=0, end=3600, number=200)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endNo
destNo
beginNo
numberNo
sourceNo
flow_idNo
dest_latNo
dest_lonNo
net_fileYes
output_dirNooutput/trips
route_fileYes
source_latNo
source_lonNo
search_radiusNo
use_geocodingNo
vehs_per_hourNo
Behavior4/5

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

The description discloses important behaviors such as geocoding usage, safety parameter defaults, and the chaining mechanism. However, it does not specify the return value or output format, which is a gap given no output schema. Overall, it provides good transparency for inputs and internal behavior.

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

Conciseness5/5

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

The description is well-organized with sections (purpose, modes, safety, chaining, parameters, examples). Each sentence adds value, and the structure allows quick scanning. It is appropriately sized for the tool's complexity.

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 the tool's complexity (16 parameters, no output schema, no annotations), the description covers most aspects including parameter roles and chaining. It lacks explicit mention of the return value and error handling, but overall it is sufficiently complete for an AI agent to use effectively.

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?

With 0% schema description coverage, the description compensates excellently by explaining each parameter in the 'Args:' block, including defaults, mutual exclusivity, and usage in examples. It adds significant meaning beyond the bare schema definitions.

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 the tool generates a SUMO flow from source to destination, distinguishing two location modes and two vehicle count modes. It is specific about the resource (SUMO flow) and operation (generate), effectively differentiating from sibling tools like trip_generate or route_generate.

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 guidance on how to specify locations (place names vs coordinates) and vehicle count (vehs_per_hour vs number), including when to use coordinate mode. It also explains chaining for multi-OD scenarios. However, it does not explicitly compare to sibling tools or state when not to use this tool.

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