set_track_volume
Adjust a track's volume level in decibels by specifying the track index and desired volume value, with a range from -150 dB to +12 dB.
Instructions
Set track volume in dB. Range: roughly -150 to +12 dB.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| track_index | Yes | ||
| volume_db | Yes |
Implementation Reference
- src/reaper_mcp/track_tools.py:62-71 (handler)The set_track_volume tool handler: accepts a track_index and volume_db (float in dB), looks up the track via reapy, sets track.volume, and returns success/error.
@mcp.tool() def set_track_volume(track_index: int, volume_db: float) -> dict: """Set track volume in dB. Range: roughly -150 to +12 dB.""" try: project = get_project() track = project.tracks[track_index] track.volume = volume_db return {"success": True, "track_index": track_index, "volume_db": track.volume} except Exception as e: return {"success": False, "error": str(e)} - src/reaper_mcp/track_tools.py:11-11 (registration)The register_tools function receives the mcp (FastMCP) instance. The @mcp.tool() decorator above set_track_volume registers it as an MCP tool.
def register_tools(mcp): - src/reaper_mcp/server.py:11-21 (registration)In server.py, track_tools.register_tools is imported and called with the mcp instance, which triggers the @mcp.tool() decorators to register all track tools including set_track_volume.
from reaper_mcp.track_tools import register_tools as _reg_track from reaper_mcp.midi_tools import register_tools as _reg_midi from reaper_mcp.fx_tools import register_tools as _reg_fx from reaper_mcp.audio_tools import register_tools as _reg_audio from reaper_mcp.mixing_tools import register_tools as _reg_mixing from reaper_mcp.render_tools import register_tools as _reg_render from reaper_mcp.mastering_tools import register_tools as _reg_mastering from reaper_mcp.analysis_tools import register_tools as _reg_analysis _reg_project(mcp) _reg_track(mcp) - src/reaper_mcp/connection.py:27-29 (helper)The get_project() helper ensures a REAPER connection and returns the current project, used by set_track_volume to access tracks.
def get_project() -> reapy.Project: ensure_connected() return reapy.Project()