insert_audio_file
Add audio files to specific tracks at precise time positions in REAPER projects for audio editing and arrangement.
Instructions
Insert an audio file onto a track at the given position (seconds).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"track_index": "<track_index>",
"file_path": "<file_path>",
"position": "<position>"
},
"name": "insert_audio_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| track_index | Yes | ||
| file_path | Yes | ||
| position | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/reaper_mcp/server.py:435-451 (handler)The handler function for the `insert_audio_file` tool, which is registered as an MCP tool and calls the adapter.
@mcp.tool() def insert_audio_file( track_index: int, file_path: str, position: float, ) -> dict[str, Any]: """Insert an audio file onto a track at the given position (seconds).""" try: return _wrap( adapter.insert_audio_file( track_index=track_index, file_path=file_path, position=position, ) ) except Exception as exc: return _err(exc) - The adapter method that facilitates the actual communication with the Reaper client to insert the audio file.
def insert_audio_file( self, track_index: int, file_path: str, position: float, ) -> dict[str, Any]: return self._client.call( "insert_audio_file", track_index=track_index, file_path=file_path, position=position, )