Skip to main content
Glama
romanstark

Ableton Maestro

write_clip_notes

Replace or append MIDI notes in an Ableton Live Session clip and verify the write by reading back notes within a tolerance.

Instructions

Write MIDI notes into a Session clip. Replaces notes by default.

Args:
    track: Track index in song.tracks (MIDI track).
    slot: Scene/slot index in track.clip_slots.
    notes: List of note dictionaries with pitch, start_time, duration, velocity,
        and optional probability, velocity_deviation, release_velocity, mute.
    mode: Write mode, 'replace' (clears prior notes and writes) or 'append'.
    verify: When True, reads back notes and compares with input using diff.

Returns:
    Dictionary containing write confirmation, validation reports, and optional diff.

Note:
    Times are in beats and clip-local, so beat 0 is the clip's own start.

    A list straight from ``read_clip_notes`` can be written back. Live adds
    ``note_id`` to every note it hands out, which is identity rather than content,
    so the keys in :data:`~ableton_maestro.music.notes.TOLERATED_NOTE_KEYS` are
    dropped instead of refused and reported as ``input_keys_ignored``. Every other
    unrecognised key is an error.

    ``pitch``, ``start_time`` and ``duration`` are never defaulted. A reader that
    substitutes ``start_time=0.0`` and ``duration=0.25`` for missing keys turns a
    list built with ``pos``/``dur`` (the humanise spelling) into a pile of
    sixteenths stacked on beat 0, and reports success while doing it. Wrong keys are
    refused before anything is sent.

    ``replace`` is remove-then-write inside one handler call. Live's own
    ``set_notes`` appends, so a second write silently doubles a melody instead of
    correcting it (measured: 63 + 23 = 86 notes). Ask for ``append`` by name when
    adding is the intent. An empty list with ``mode="replace"`` clears the clip.

    A note does not come back bit-identical to the note sent. Times and durations
    return with a small deviation in both directions. Measured 2026-09-01 against
    Live 12.4.5: a sent 0.29 read back as 0.29000010406260407 and a sent 0.18 as
    0.17999994796869798, about 4e-7 relative. Re-measured 2026-09-02 against Live
    12.4.5 at 124 BPM: both values reproduced to every digit, a ``start_time`` of
    2.29 came back as 2.290000104062604, and a duration of 0.5 came back exactly.
    The cause is not established: it is not a tick grid (no grid of 96, 192, 480 or
    960 per quarter produces those numbers) and not a single float32 conversion
    (float32 of 0.29 is 0.28999999). That 0.5 survives while 0.29 does not is
    consistent with a binary-representable value passing through untouched, but the
    mechanism is not claimed here. At 124 BPM the error is around 50 nanoseconds, so
    musically it is nothing. It matters only for comparison: never test a note time
    for equality. The diff run here already uses a tolerance, which is why it
    reports ``0 changed`` for values that differ in the seventh decimal.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNoreplace
slotYes
notesYes
trackYes
verifyNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.1.0

TDQS

A5/5.0
Behavior5/5

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

With no annotations, the description carries the full burden, and it delivers: it discloses remove-then-write semantics, the silent-doubling risk with append, tolerance-based verification, handling of note_id and unknown keys, and measured floating-point deviations in times and durations. It even explains why equality testing should never be used. This is exceptionally transparent.

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?

Although long, the description is tightly structured: a one-line summary, an Args block, Returns, and a Note section. Every paragraph addresses a real failure mode or clarification an agent would need before calling the tool. The detailed precision measurements may be verbose, but they directly support the warning never to test note times for equality.

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

Completeness5/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, the description is complete: it covers replacement vs. append behavior, clearing, verification semantics, key validation, round-tripping from read_clip_notes, time units, and numeric precision. An agent has everything needed to call this tool correctly and interpret its results.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must explain parameters, and it does thoroughly: track and slot indices, notes as dictionaries with required and optional keys, mode values, and verify's read-back diff behavior. It adds meaning well beyond bare parameter names, including the clip-local beat convention and which keys are tolerated versus refused.

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

Purpose5/5

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

The opening sentence states a specific verb and resource: 'Write MIDI notes into a Session clip.' It also immediately distinguishes default behavior ('Replaces notes by default') from the sibling read tool. No ambiguity remains about what this tool is for.

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

Usage Guidelines5/5

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

The description gives explicit mode guidance: use 'replace' by default, 'ask for append by name when adding is the intent,' and notes that an empty list with 'replace' clears the clip. It also warns that Live's own set_notes appends, explaining why the default replacement behavior matters. This is actionable guidance for choosing behavior within the tool.

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

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/romanstark/ableton-maestro'

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