set_track_name_tool
Rename tracks in Ableton Live using the MCP server by specifying the track index and desired name, enabling precise control for AI-assisted music production.
Instructions
Set the name of a track.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| track_index | Yes |
Implementation Reference
- MCP_Server/server.py:81-84 (handler)The main handler function for the 'set_track_name_tool' MCP tool. It is registered via the @mcp.tool() decorator and delegates execution to the set_track_name helper function.@mcp.tool() def set_track_name_tool(ctx: Context, track_index: int, name: str) -> str: """Set the name of a track.""" return set_track_name(ctx, track_index, name)
- Helper function that handles the logic for setting track name by sending a command to the Ableton remote connection.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 the Ableton remote script that directly sets the track name using the Ableton Live API.def set_track_name(self, track_index: int, name: str) -> dict[str, Any]: """Set the name of a track""" try: track = self.get_track(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