create_bus
Create a new bus track and route selected tracks to it via sends for group processing.
Instructions
Create a new bus track and route the given tracks to it via sends. track_indices: list of track indices to feed into the bus.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| track_indices | Yes |
Implementation Reference
- src/reaper_mcp/mixing_tools.py:137-160 (handler)The create_bus tool handler: creates a new bus track and routes given tracks to it via sends. Uses `project.n_tracks` for the new track index, `project.add_track()` to create it, and `RPR.CreateTrackSend()` to route each source track to the bus.
@mcp.tool() def create_bus(name: str, track_indices: list) -> dict: """ Create a new bus track and route the given tracks to it via sends. track_indices: list of track indices to feed into the bus. """ try: project = get_project() bus_idx = project.n_tracks project.add_track(bus_idx, name) bus_track = project.tracks[bus_idx] sends = [] for idx in track_indices: src = project.tracks[idx] send_i = RPR.CreateTrackSend(src.id, bus_track.id) sends.append({"track_index": idx, "send_index": send_i}) return { "success": True, "bus_index": bus_idx, "bus_name": name, "sends": sends, } except Exception as e: return {"success": False, "error": str(e)} - src/reaper_mcp/mixing_tools.py:17-17 (registration)The `register_tools(mcp)` function that registers all mixing tools (including create_bus) via the `@mcp.tool()` decorator. Called from server.py line 25.
def register_tools(mcp): - src/reaper_mcp/server.py:15-15 (registration)Import of mixing_tools.register_tools in the server module, which is called on line 25 to register create_bus.
from reaper_mcp.mixing_tools import register_tools as _reg_mixing - src/reaper_mcp/server.py:25-25 (registration)Invocation of mixing_tools.register_tools(mcp), which registers the create_bus tool.
_reg_mixing(mcp) - src/reaper_mcp/connection.py:27-29 (helper)Helper function `get_project()` used by create_bus to obtain the current REAPER project.
def get_project() -> reapy.Project: ensure_connected() return reapy.Project()