Skip to main content
Glama

create_midi_track

Add a MIDI track to your Ableton Live session at a specified position to organize and expand your music project.

Instructions

Create a new MIDI track in the Ableton session.

Parameters:

  • index: The index to insert the track at (-1 = end of list)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
indexNo

Implementation Reference

  • MCP tool handler for create_midi_track. Gets Ableton connection and sends the internal create_midi_track command to the remote script with the index parameter.
    @mcp.tool() def create_midi_track(ctx: Context, index: int = -1) -> str: """ Create a new MIDI track in the Ableton session. Parameters: - index: The index to insert the track at (-1 = end of list) """ try: ableton = get_ableton_connection() result = ableton.send_command("create_midi_track", {"index": index}) return f"Created new MIDI track: {result.get('name', 'unknown')}" except Exception as e: logger.error(f"Error creating MIDI track: {str(e)}") return f"Error creating MIDI track: {str(e)}"
  • Input schema from function signature and docstring: index (int, default -1). Returns str describing the result.
    def create_midi_track(ctx: Context, index: int = -1) -> str: """ Create a new MIDI track in the Ableton session. Parameters: - index: The index to insert the track at (-1 = end of list) """
  • Registration of the tool using FastMCP @mcp.tool() decorator.
    @mcp.tool()
  • Helper function in Ableton remote script implementing the actual track creation using Ableton Live API: self._song.create_midi_track(index)
    def _create_midi_track(self, index): """Create a new MIDI track at the specified index""" try: # Create the track self._song.create_midi_track(index) # Get the new track new_track_index = len(self._song.tracks) - 1 if index == -1 else index new_track = self._song.tracks[new_track_index] result = { "index": new_track_index, "name": new_track.name } return result except Exception as e: self.log_message("Error creating MIDI track: " + str(e)) raise

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