add_device
Add audio effects or instruments to Ableton Live tracks to enhance music production workflows.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| track_index | Yes | ||
| device_type | Yes |
Implementation Reference
- MCP_Server/server.py:687-695 (handler)MCP tool handler function for 'add_device'. Proxies the request to the Ableton remote script by sending a socket command.@mcp.tool() def add_device(ctx: Context, track_index: int, device_type: str) -> str: try: ableton = get_ableton_connection() result = ableton.send_command("add_device", {"track_index": track_index, "device_type": device_type}) return f"Added device type '{result.get('device_type')}' to track '{result.get('track_name')}' - Note: {result.get('note')}" except Exception as e: logger.error(f"Error adding device: {str(e)}") return f"Error adding device: {str(e)}"
- Underlying implementation in Ableton remote script that handles the 'add_device' socket command from MCP server. Currently a stub that returns success without actually adding a device.def _add_device(self, track_index, device_type): """Add a device to a track""" try: if track_index < 0 or track_index >= len(self._song.tracks): raise IndexError("Track index out of range") track = self._song.tracks[track_index] # This is a simplified implementation - in reality, you'd need to # use the browser to load specific devices # For now, we'll just return success result = { "added": True, "device_type": device_type, "track_name": track.name, "note": "Device loading requires browser integration" } return result except Exception as e: self.log_message("Error adding device: " + str(e)) raise
- MCP_Server/server.py:687-695 (registration)The @mcp.tool() decorator registers the add_device function as an MCP tool.@mcp.tool() def add_device(ctx: Context, track_index: int, device_type: str) -> str: try: ableton = get_ableton_connection() result = ableton.send_command("add_device", {"track_index": track_index, "device_type": device_type}) return f"Added device type '{result.get('device_type')}' to track '{result.get('track_name')}' - Note: {result.get('note')}" except Exception as e: logger.error(f"Error adding device: {str(e)}") return f"Error adding device: {str(e)}"