set_track_name
Rename a specific track in Ableton Live by specifying its index and the desired new name, enabling precise track management during AI-assisted music production.
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 |
|---|---|---|---|
| name | Yes | ||
| track_index | 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 connection and returns success/error message.@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)}"
- Actual implementation in Ableton remote script that uses Live API to set the track name and returns the new name.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
- Dispatching logic in remote script's command processor that calls the _set_track_name helper.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) elif command_type == "create_clip":