Skip to main content
Glama

run_scenario

Convert natural language into a validated CARLA scenario and execute it. Supports cut-in, pedestrian, and weather parameters.

Instructions

Generate and execute a CARLA scenario from natural language.

Builds a validated :class:ScenarioManifest from flat parameters and runs it. At least one of the cut_in_*, pedestrian_*, or weather_* groups must be provided. Optionally persists the validated spec for replay.

Args: nl_prompt (str): The natural-language description of the scenario. cut_in_speed_kmh (Optional[float]): See :func:_build_manifest. cut_in_ttc_s (Optional[float]): See :func:_build_manifest. cut_in_side (Optional[str]): See :func:_build_manifest. cut_in_ego_speed_kmh (float): See :func:_build_manifest. cut_in_map (str): See :func:_build_manifest. pedestrian_gap_s (Optional[float]): See :func:_build_manifest. pedestrian_distance_m (Optional[float]): See :func:_build_manifest. pedestrian_occluded (bool): See :func:_build_manifest. weather_condition (Optional[str]): See :func:_build_manifest. weather_intensity (Optional[float]): See :func:_build_manifest. save_as (Optional[str]): If given, save the validated spec under this name for later replay.

Returns: dict: The execution result, or an error/hint payload if validation failed.

Examples: Aggressive cut-in from the right at 120 km/h::

    run_scenario("...", cut_in_speed_kmh=120, cut_in_ttc_s=1.2,
                 cut_in_side="right")

Occluded pedestrian crossing 30 m ahead::

    run_scenario("...", pedestrian_gap_s=1.5, pedestrian_distance_m=30,
                 pedestrian_occluded=True)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nl_promptYes
cut_in_speed_kmhNo
cut_in_ttc_sNo
cut_in_sideNo
cut_in_ego_speed_kmhNo
cut_in_mapNoTown04
pedestrian_gap_sNo
pedestrian_distance_mNo
pedestrian_occludedNo
weather_conditionNo
weather_intensityNo
save_asNo
Behavior3/5

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

No annotations provided, so description carries burden. Discloses building, running, and optional persistence, and returns error/hint on validation failure. Missing details on execution side effects (e.g., simulation impact, resource usage, or destructiveness).

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?

Well-structured with summary, task, Args, Returns, and Examples. Front-loaded with purpose. However, the Args section is repetitive with 'See :func:`_build_manifest`' for multiple parameters, reducing conciseness.

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

Completeness3/5

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

Given 12 parameters and no output schema, the description covers required groups, basic return format, and examples. Lacks details on success response structure or possible error states beyond validation, and does not explain how this tool interacts with the simulation environment.

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

Parameters3/5

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

Schema coverage is 0%, so description adds value with Args section and examples showing parameter grouping. However, many Args just reference '_build_manifest' without actual semantics, and no enum constraints are described despite their presence.

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 and execute a CARLA scenario from natural language,' specifies building a validated ScenarioManifest and running it, and distinguishes from siblings like validate_scenario and replay_scenario.

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?

It explicitly requires at least one parameter group (cut_in_*, pedestrian_*, weather_*), provides option to persist for replay, and implies execution vs. validation or replay. However, it does not explicitly state when to use this tool over siblings like validate_scenario.

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/codebymov/CARLA-MCP'

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