Skip to main content
Glama

add_device

Add audio effects or instruments to Ableton Live tracks to enhance music production workflows.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
track_indexYes
device_typeYes

Implementation Reference

  • 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
  • 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)}"

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Milesy1/MCP-Ableton-API'

If you have feedback or need assistance with the MCP directory API, please join our Discord server