Skip to main content
Glama

quantize_clip

Idempotent

Fix timing in MIDI clips by snapping notes to a specified beat grid. Adjust strength to preserve groove, or quantize note endings to alter note lengths.

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.
slotYesClip 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.
trackYesTrack index in song.tracks, counted from 0.
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. Dates show when Glama detected each change.

  1. 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."
  2. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

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

The description discloses the full behavioral pipeline: reads notes, calculates quantized positions, writes back using mode='replace', and verifies the result. It also warns that quantizing modifies notes in place and is not undoable, adding important safety context beyond the annotations. There is no contradiction with readOnlyHint=false or idempotentHint=true.

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 structured and front-loaded: purpose, process, return value, parameter notes, side-effect warning, and alternatives. Every section earns its place, and the language is tight without redundancy.

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?

Given the tool's complexity, the description is complete: it explains return contents, irreversible in-place modification, parameter interactions, and alternative tools. Required parameters track and slot are fully covered by the input schema, so nothing necessary for correct invocation is missing.

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

Parameters4/5

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

Schema coverage is 100%, so parameters are already documented. The description adds value by explaining parameter interactions: strength scales displacement from 0.0 to 1.0 with partial-use guidance, and quantize_ends behavior is clarified with articulation-preservation context. This goes beyond the schema without needing to repeat basic field meanings.

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 opens with a specific verb and resource: 'Quantize MIDI clip note positions and lengths to a specified beat grid.' It clearly distinguishes itself from siblings by explicitly naming transpose_clip for pitch shifts and write_clip_notes for custom off-grid notes, so an agent can select the right tool 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?

The description provides explicit when-to-use guidance and alternatives: use transpose_clip to shift pitch instead of timing, and write_clip_notes for custom or micro-timed off-grid notes. It also instructs the agent to call read_clip_notes first if original unquantized timing may be needed, which is clear prerequisite guidance.

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/live-maestro'

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