Skip to main content
Glama

load_instrument_or_effect

Load instruments or effects onto Ableton Live tracks using URI identifiers to add sound processing and synthesis capabilities during music production.

Instructions

Load an instrument or effect onto a track using its URI.

Parameters:

  • track_index: The index of the track to load the instrument on

  • uri: The URI of the instrument or effect to load (e.g., 'query:Synths#Instrument%20Rack:Bass:FileId_5116')

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
track_indexYes
uriYes

Implementation Reference

  • The primary handler for the 'load_instrument_or_effect' MCP tool. It forwards the request to the Ableton remote script via the 'load_browser_item' command.
    @mcp.tool()
    def load_instrument_or_effect(ctx: Context, track_index: int, uri: str) -> str:
        """
        Load an instrument or effect onto a track using its URI.
        
        Parameters:
        - track_index: The index of the track to load the instrument on
        - uri: The URI of the instrument or effect to load (e.g., 'query:Synths#Instrument%20Rack:Bass:FileId_5116')
        """
        try:
            ableton = get_ableton_connection()
            result = ableton.send_command("load_browser_item", {
                "track_index": track_index,
                "item_uri": uri
            })
            
            # Check if the instrument was loaded successfully
            if result.get("loaded", False):
                new_devices = result.get("new_devices", [])
                if new_devices:
                    return f"Loaded instrument with URI '{uri}' on track {track_index}. New devices: {', '.join(new_devices)}"
                else:
                    devices = result.get("devices_after", [])
                    return f"Loaded instrument with URI '{uri}' on track {track_index}. Devices on track: {', '.join(devices)}"
            else:
                return f"Failed to load instrument with URI '{uri}'"
        except Exception as e:
            logger.error(f"Error loading instrument by URI: {str(e)}")
            return f"Error loading instrument by URI: {str(e)}"
  • Function signature and docstring defining the input schema (track_index: int, uri: str) and output (str response).
    def load_instrument_or_effect(ctx: Context, track_index: int, uri: str) -> str:
        """
        Load an instrument or effect onto a track using its URI.
        
        Parameters:
        - track_index: The index of the track to load the instrument on
        - uri: The URI of the instrument or effect to load (e.g., 'query:Synths#Instrument%20Rack:Bass:FileId_5116')
        """
  • Low-level helper in the Ableton remote script that implements the actual loading of browser items (instruments/effects) onto tracks, called by the MCP server's forwarded command.
    def _load_browser_item(self, track_index, item_uri):
        """Load a browser item onto a track by its URI"""
        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]
            
            # Access the application's browser instance instead of creating a new one
            app = self.application()
            
            # Find the browser item by URI
            item = self._find_browser_item_by_uri(app.browser, item_uri)
            
            if not item:
                raise ValueError("Browser item with URI '{0}' not found".format(item_uri))
            
            # Select the track
            self._song.view.selected_track = track
            
            # Load the item
            app.browser.load_item(item)
            
            result = {
                "loaded": True,
                "item_name": item.name,
                "track_name": track.name,
                "uri": item_uri
            }
            return result
        except Exception as e:
            self.log_message("Error loading browser item: {0}".format(str(e)))
            self.log_message(traceback.format_exc())
            raise
  • Recursive helper function in the Ableton remote script to locate a browser item by its URI across the browser tree.
    def _find_browser_item_by_uri(self, browser_or_item, uri, max_depth=10, current_depth=0):
        """Find a browser item by its URI"""
        try:
            # Check if this is the item we're looking for
            if hasattr(browser_or_item, 'uri') and browser_or_item.uri == uri:
                return browser_or_item
            
            # Stop recursion if we've reached max depth
            if current_depth >= max_depth:
                return None
            
            # Check if this is a browser with root categories
            if hasattr(browser_or_item, 'instruments'):
                # Check all main categories
                categories = [
                    browser_or_item.instruments,
                    browser_or_item.sounds,
                    browser_or_item.drums,
                    browser_or_item.audio_effects,
                    browser_or_item.midi_effects
                ]
                
                for category in categories:
                    item = self._find_browser_item_by_uri(category, uri, max_depth, current_depth + 1)
                    if item:
                        return item
                
                return None
            
            # Check if this item has children
            if hasattr(browser_or_item, 'children') and browser_or_item.children:
                for child in browser_or_item.children:
                    item = self._find_browser_item_by_uri(child, uri, max_depth, current_depth + 1)
                    if item:
                        return item
            
            return None
        except Exception as e:
            self.log_message("Error finding browser item by URI: {0}".format(str(e)))
            return None
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('Load') but does not explain what happens during loading (e.g., whether it replaces existing content, requires specific permissions, or has side effects like mutating track state). This is a significant gap for a tool that likely modifies session data.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose in the first sentence, followed by a clear parameter list with brief explanations. Every sentence adds value without redundancy, making it efficient and easy to parse for an agent.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of loading instruments/effects in a music production tool, the description is minimally adequate. It covers the basic purpose and parameters but lacks details on behavior, output, or integration with siblings. With no annotations or output schema, it leaves gaps in understanding the full context of use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds meaningful context for both parameters: 'track_index' is explained as 'The index of the track to load the instrument on', and 'uri' includes an example ('e.g., 'query:Synths#Instrument%20Rack:Bass:FileId_5116''). Since schema description coverage is 0%, this compensates well by clarifying parameter purposes beyond the basic schema types.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Load an instrument or effect') and the target ('onto a track using its URI'), which is specific and actionable. However, it does not explicitly differentiate from sibling tools like 'load_drum_kit' or 'create_midi_track', which might have overlapping purposes in a music production context, so it falls short of a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It does not mention prerequisites, such as needing an existing track or valid URI, or compare it to siblings like 'load_drum_kit' or 'create_midi_track', leaving the agent to infer usage context from the tool name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/ahujasid/ableton-mcp'

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