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

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