Skip to main content
Glama

add_notes_to_clip

Add MIDI notes to a specific clip in Ableton Live using clip ID and note details like pitch, duration, and velocity for precise music production.

Instructions

Add notes to clip by clip id

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
clip_idYes
notesYes[array] the notes to add.

Implementation Reference

  • The main execution handler for the 'add_notes_to_clip' tool. It retrieves the clip by ID, creates a note snapshot for undo support, sets the new notes on the clip, and returns success.
    @tool({
        name: 'add_notes_to_clip',
        description: 'Add notes to clip by clip id',
        enableSnapshot: true,
        paramsSchema: {
            notes: z.array(NOTE).describe('[array] the notes to add.'),
            clip_id: z.string()
        }
    })
    async addClipNotes({ notes, clip_id, historyId }: { notes: Note[], clip_id: string, historyId: number }) {
        const clip = getClipById(clip_id)
        await createNoteSnapshot(clip, historyId)
        await clip.setNotes(notes)
        return Result.ok()
    }
  • Zod schema for individual NOTE objects, used in the tool's input schema as z.array(NOTE).
    export const NOTE = createZodSchema<Note>({
        pitch: z.number().min(0).max(127).describe('[int] the MIDI note number, 0...127, 60 is C3.'),
        time: z.number().describe('[float] the note start time in beats of absolute clip time.'),
        duration: z.number().describe('[float] the note length in beats.'),
        velocity: z.number().min(0).max(127).default(100)
            .describe('[float] the note velocity, 0 ... 127 (100 by default).'),
        muted: z.boolean().default(false).describe('[bool] true = the note is deactivated (false by default).')
    })
  • src/main.ts:39-42 (registration)
    The ClipTools class containing the add_notes_to_clip handler is registered here in the tools array for the MCP server.
    await startMcp({
        // Register tool classes, make decorators available
        tools: [BrowserTools, ClipTools, DeviceTools, HistoryTools, SongTools, TrackTools, ExtraTools, ApplicationTools]
    })
  • src/main.ts:8-8 (registration)
    Import of the ClipTools class that defines the tool.
    import ClipTools from './tools/clip-tools.js'
  • Imports of helper functions used in the handler: getClipById to retrieve clip, createNoteSnapshot for undo history.
    import { batchModifyClipProp, getClipProps, NoteToNoteExtended } from '../utils/obj-utils.js'
    import { Result } from '../utils/common.js'
    import { getClipById } from '../utils/obj-utils.js'
    import { createNoteSnapshot, getNotes, removeNotesExtended, replaceClipNotesExtended } from '../utils/clip-utils.js'
    import { ableton } from '../ableton.js'
    
    class ClipTools {
    
        @tool({
            name: 'get_clip_properties',
            description: 'Get clip properties by clip id. To get specific properties, set the corresponding property name to true in the properties parameter.',
            paramsSchema: {
                clip_id: z.string(),
                properties: ClipGettableProp,
            }
        })
        async getClipInfoById({ clip_id, properties }: { clip_id: string, properties: z.infer<typeof ClipGettableProp> }) {
            const clip = getClipById(clip_id)
            return await getClipProps(clip, properties)
        }
    
        @tool({
            name: 'get_clip_notes',
            description: 'Get clip notes by clip id. Returns NoteExtended array for Live 11+ and Note array for Live 10 and below',
            paramsSchema: {
                clip_id: z.string(),
                from_pitch: z.number().min(0).max(127),
                from_time: z.number(),
                time_span: z.number(),
                pitch_span: z.number(),
            }
        })
        async getClipNotes({ clip_id, from_pitch, from_time, time_span, pitch_span }: { clip_id: string, from_pitch: number, from_time: number, time_span: number, pitch_span: number }) {
            const clip = getClipById(clip_id)
            const notes = await getNotes(clip, from_pitch, pitch_span, from_time, time_span)
            return Result.data(notes)
        }
    
        @tool({
            name: 'remove_clip_notes',
            description: 'Remove clip notes by clip id',
            enableSnapshot: true,
            paramsSchema: {
                clip_id: z.string(),
                from_pitch: z.number().min(0).max(127),
                pitch_span: z.number().describe('The number of semitones to remove. Must be a value greater than 0.'),
                from_time: z.number(),
                time_span: z.number().describe('The number of beats to remove. Must be a value greater than 0.'),
            }
        })
        async removeClipNotes({ clip_id, from_pitch, pitch_span, from_time, time_span, historyId }: {
            clip_id: string
            from_pitch: number
            pitch_span: number
            from_time: number
            time_span: number
            historyId: number
        }) {
            const clip = getClipById(clip_id)
            await createNoteSnapshot(clip, historyId)
            await removeNotesExtended(clip, from_pitch, pitch_span, from_time, time_span)
            return Result.ok()
        }
    
        @tool({
            name: 'remove_notes_by_ids',
            description: 'Remove notes by clip id and note ids',
            enableSnapshot: true,
            paramsSchema: {
                clip_id: z.string(),
                note_ids: z.array(z.number()).describe('note ids, get from get_clip_notes'),
            }
        })
        async removeClipNotesById({ clip_id, note_ids, historyId }: { clip_id: string, note_ids: number[], historyId: number }) {
            const clip = getClipById(clip_id)
            await createNoteSnapshot(clip, historyId)
            await clip.removeNotesById(note_ids)
            return Result.ok()
        }
    
        @tool({
            name: 'add_notes_to_clip',
            description: 'Add notes to clip by clip id',
            enableSnapshot: true,
            paramsSchema: {
                notes: z.array(NOTE).describe('[array] the notes to add.'),
                clip_id: z.string()
            }
        })
        async addClipNotes({ notes, clip_id, historyId }: { notes: Note[], clip_id: string, historyId: number }) {
            const clip = getClipById(clip_id)
            await createNoteSnapshot(clip, historyId)
            await clip.setNotes(notes)
            return Result.ok()
        }
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 ('Add notes') but doesn't explain whether this is an append operation, if it overwrites existing notes, requires specific permissions, or has side effects. This is inadequate for a mutation tool with zero annotation coverage.

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 a single, direct sentence with no wasted words, making it highly concise and front-loaded. Every word contributes to stating the tool's purpose efficiently.

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

Completeness2/5

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

For a mutation tool with no annotations, no output schema, and incomplete parameter documentation (50% schema coverage), the description is insufficient. It doesn't address behavioral traits, usage context, or output expectations, leaving significant gaps for an AI agent to understand and invoke the tool correctly.

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

Parameters3/5

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

The description mentions 'clip id' and 'notes', aligning with the two parameters in the schema. However, with 50% schema description coverage (only 'notes' has a description), the 'clip_id' parameter lacks documentation in both schema and description. The description adds minimal value beyond the schema's partial coverage.

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 ('Add notes to clip') and specifies the resource ('clip by clip id'), making the purpose unambiguous. However, it doesn't differentiate from sibling tools like 'replace_all_notes_to_clip' or 'get_all_notes_by_clipid', which would require explicit comparison to achieve 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?

No guidance is provided on when to use this tool versus alternatives. The description lacks context about prerequisites (e.g., clip existence), exclusions, or comparisons to similar tools like 'replace_all_notes_to_clip' or 'remove_clip_all_notes', leaving usage unclear.

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

Related 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/xiaolaa2/ableton-copilot-mcp'

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