create_track
Generate and add a new track in Ableton Live via MCP. Specify track type (audio, midi, or return) and optional index for precise placement in your project.
Instructions
create track and return raw track
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| index | No | [int] index of track default 0, range [0, track count] | |
| type | Yes | the type of track, "return", "audio", "midi" |
Implementation Reference
- src/tools/song-tools.ts:56-70 (handler)The main execution logic for the 'create_track' tool. Creates a MIDI, audio, or return track in Ableton Live at the given index using the song's API methods and returns the raw track object.async createTrack({ type, index = 0 }: { type: TrackType, index?: number }) { let track: Track switch (type) { case TrackType.midi: track = await ableton.song.createMidiTrack(index) break case TrackType.audio: track = await ableton.song.createAudioTrack(index) break case TrackType.return: track = await ableton.song.createReturnTrack() break } return track.raw }
- src/tools/song-tools.ts:48-55 (registration)Registers the `createTrack` method as the MCP tool named 'create_track' using the @tool decorator, including description and input schema definition.@tool({ name: 'create_track', description: 'create track and return raw track', paramsSchema: { type: ZodTrackType, index: z.number().optional().default(0).describe('[int] index of track default 0, range [0, track count]'), } })
- src/main.ts:41-41 (registration)Includes the SongTools class in the list of tools passed to the MCP server starter (`startMcp`), enabling registration of all its decorated tools including 'create_track'.tools: [BrowserTools, ClipTools, DeviceTools, HistoryTools, SongTools, TrackTools, ExtraTools, ApplicationTools]
- src/tools/song-tools.ts:52-54 (schema)Defines the input schema for the 'create_track' tool within the @tool decorator: track type (enum via ZodTrackType) and optional index.type: ZodTrackType, index: z.number().optional().default(0).describe('[int] index of track default 0, range [0, track count]'), }