set_track_name
Rename tracks in Ableton Live sessions by specifying track index and new name to organize music production projects.
Instructions
Set the name of a track.
Parameters:
track_index: The index of the track to rename
name: The new name for the track
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| track_index | Yes | ||
| name | Yes |
Implementation Reference
- MCP_Server/server.py:305-320 (handler)MCP tool handler for 'set_track_name'. Forwards the command to the Ableton remote script via socket, handles connection and errors.@mcp.tool() def set_track_name(ctx: Context, track_index: int, name: str) -> str: """ Set the name of a track. Parameters: - track_index: The index of the track to rename - name: The new name for the track """ try: ableton = get_ableton_connection() result = ableton.send_command("set_track_name", {"track_index": track_index, "name": name}) return f"Renamed track to: {result.get('name', name)}" except Exception as e: logger.error(f"Error setting track name: {str(e)}") return f"Error setting track name: {str(e)}"
- Core implementation in Ableton remote script that directly sets track.name using Ableton Live API and returns confirmation.def _set_track_name(self, track_index, name): """Set the name of a track""" try: if track_index < 0 or track_index >= len(self._song.tracks): raise IndexError("Track index out of range") # Set the name track = self._song.tracks[track_index] track.name = name result = { "name": track.name } return result except Exception as e: self.log_message("Error setting track name: " + str(e)) raise
- AbletonMCP_Remote_Script/__init__.py:229-233 (registration)Dispatch/registration point in remote script's _process_command where 'set_track_name' internal command is handled and routed to _set_track_name.elif command_type in ["create_midi_track", "set_track_name", "create_clip", "add_notes_to_clip", "set_clip_name", "set_tempo", "fire_clip", "stop_clip", "start_playback", "stop_playback", "load_browser_item"]: # Use a thread-safe approach with a response queue
- Specific dispatch handler within the main thread task for the 'set_track_name' command in remote script.elif command_type == "set_track_name": track_index = params.get("track_index", 0) name = params.get("name", "") result = self._set_track_name(track_index, name)