Skip to main content
Glama

quantize_clip

Idempotent

Align MIDI notes to a beat grid in an Ableton Live clip. Tighten timing by snapping note starts, with optional strength to preserve groove and quantize ends to adjust note durations.

Instructions

Quantize MIDI clip note positions and lengths to a specified beat grid.

Reads notes, calculates quantized positions, writes back using mode='replace',
and verifies the result.

Returns:
    Dictionary with the write result, the number of notes moved, and how far.

Note:
    Parameter interactions: ``strength`` scales note displacement towards ``grid`` from
    0.0 (raw timing preserved) to 1.0 (full snap). Use partial strength (e.g. 0.5) to
    tighten timing while preserving human groove feel. Setting ``quantize_ends=True``
    snaps note ends to the grid too, adjusting note lengths. In contrast,
    ``quantize_ends=False`` shifts note onsets only and preserves articulation.

    Quantising modifies notes in place and is not undoable. Read the notes first with
    read_clip_notes if the original unquantized timing might be needed later.

    To shift pitch instead of timing, use transpose_clip. To write custom or micro-timed
    notes off-grid, use write_clip_notes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
gridNoGrid to snap to, in beats: 1.0 is a quarter note, 0.5 an eighth, 0.25 a sixteenth, and 0.3333 a triplet eighth. Must be positive.
pathNoLOM path to a Session clip, song.tracks[N].clip_slots[M] with or without a trailing .clip, as an alternative to track and slot. A song.tracks[N].arrangement_clips[i] path is refused with code region_not_addressable.
slotNoClip slot index in track.clip_slots, counted from 0, which is the scene the clip sits in. Give track and slot, or give path instead. These are Session coordinates; an Arrangement clip has none.
trackNoSession track index in song.tracks, counted from 0. Give track and slot, or give path instead. These are Session coordinates; an Arrangement clip has none.
strengthNoHow far to move each note towards the grid, 0.0 for not at all and 1.0 for all the way. 0.5 halves the distance and keeps some of the original feel.
quantize_endsNoTrue snaps note ends to the grid too, which changes durations. False moves onsets and leaves every duration as it was.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed10 schema fields changed
    • addedInput schema / properties / path
      Added value: +{
      +  "default": "",
      +  "description": "LOM path to a Session clip, song.tracks[N].clip_slots[M] with or without a trailing .clip, as an alternative to track and slot. A song.tracks[N].arrangement_clips[i] path is refused with code region_not_addressable.",
      +  "title": "Path",
      +  "type": "string"
      +}
    • addedInput schema / properties / slot / anyOf
      Added value: +[
      +  {
      +    "minimum": 0,
      +    "type": "integer"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / slot / default
      Added value: +null
    • changedInput schema / properties / slot / description
      Previous value: -"Clip slot index in track.clip_slots, counted from 0. A slot index is the scene the clip sits in, so slot 2 is the third scene down."New value: +"Clip slot index in track.clip_slots, counted from 0, which is the scene the clip sits in. Give track and slot, or give path instead. These are Session coordinates; an Arrangement clip has none."
    • removedInput schema / properties / slot / type
      Removed value: -"integer"
    • addedInput schema / properties / track / anyOf
      Added value: +[
      +  {
      +    "minimum": 0,
      +    "type": "integer"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / track / default
      Added value: +null
    • changedInput schema / properties / track / description
      Previous value: -"Track index in song.tracks, counted from 0."New value: +"Session track index in song.tracks, counted from 0. Give track and slot, or give path instead. These are Session coordinates; an Arrangement clip has none."
    • removedInput schema / properties / track / type
      Removed value: -"integer"
    • removedInput schema / required
      Removed value: -[
      -  "track",
      -  "slot"
      -]
  2. Changed5 schema fields changedv0.1.1
    • addedInput schema / properties / grid / description
      Added value: +"Grid to snap to, in beats: 1.0 is a quarter note, 0.5 an eighth, 0.25 a sixteenth, and 0.3333 a triplet eighth. Must be positive."
    • addedInput schema / properties / quantize_ends / description
      Added value: +"True snaps note ends to the grid too, which changes durations. False moves onsets and leaves every duration as it was."
    • addedInput schema / properties / slot / description
      Added value: +"Clip slot index in track.clip_slots, counted from 0. A slot index is the scene the clip sits in, so slot 2 is the third scene down."
    • addedInput schema / properties / strength / description
      Added value: +"How far to move each note towards the grid, 0.0 for not at all and 1.0 for all the way. 0.5 halves the distance and keeps some of the original feel."
    • addedInput schema / properties / track / description
      Added value: +"Track index in song.tracks, counted from 0."
  3. First observedv0.1.0

TDQS

A5/5.0
Behavior5/5

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

Annotations provide readOnlyHint=false and destructiveHint=false, but the description goes further by disclosing that quantizing modifies notes in place and is not undoable, and that it writes back using mode='replace' and verifies the result. It also explains the strength scaling and quantize_ends interaction, which is valuable behavioral context beyond the structured fields. No contradiction with annotations is present.

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 well-organized: the core purpose is front-loaded, then parameter interactions, then behavioral warnings, then alternatives. Every sentence earns its place; no fluff or repetition of schema details.

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 mutating tool with six parameters, the description covers the return format (dictionary with write result, note count, distance), handles edge cases (refusal of arrangement clip paths), and provides usage guidance. Even though an output schema exists, the description's return summary is helpful and not redundant.

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?

Although schema coverage is 100%, the description adds significant meaning: it explains strength as a displacement scale from 0.0 to 1.0 with a practical suggestion (0.5 for groove), and clarifies that quantize_ends=True snaps note ends while False preserves articulation. This goes beyond the schema's brief parameter definitions.

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 description states a specific verb (quantize) and resource (MIDI clip note positions and lengths) against a beat grid. It clearly distinguishes itself from sibling tools by naming transpose_clip for pitch and write_clip_notes for custom off-grid notes, so an agent can tell them apart without opening schemas.

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?

It explicitly says when to use this tool versus alternatives: 'To shift pitch instead of timing, use transpose_clip. To write custom or micro-timed notes off-grid, use write_clip_notes.' It also advises reading notes first with read_clip_notes if original timing might be needed later, covering both selection and prerequisite context.

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