Skip to main content
Glama

legato_midi_notes

Eliminate gaps in MIDI notes by extending each note's end to the next onset, or set all notes to one fixed length. Only note ends move, preserving start times.

Instructions

Close the gaps in a MIDI line (legato), or set every note to one length.

Only note ends move; starts are never touched. "connect" extends each note's end to the next onset and never shortens anything; a gap wider than max_gap_beats is left as a rest and counted in gaps_preserved, and the last note is left alone. "fixed" instead sets every targeted note's length to length_beats. Notes whose new end passes the item end are kept and reported in out_of_bounds.

Args: mode: "connect" (extend each end to the next onset) or "fixed" (set every length). voice: connect only. "chordal" extends to the next onset of any note, so a chord's notes move together; "per_pitch" extends to the next note of the SAME pitch and channel, keeping interleaved voices independent. max_gap_beats: connect only. Gaps wider than this are left as rests (>= 0). length_beats: fixed only. The length every targeted note is set to (> 0).

Returns: {ok, notes_changed, clamped, skipped, out_of_bounds, gaps_preserved, notes:[...]}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNoconnect
voiceNochordal
fieldsNo
channelNo
end_beatNo
pitch_lowNo
item_indexYes
pitch_highNo
start_beatNo
track_indexYes
length_beatsNo
return_notesNo
max_gap_beatsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.7.3

TDQS

A4/5.0
Behavior5/5

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

The description provides extensive behavioral detail beyond the destructiveHint annotation: starts never move, 'connect' never shortens, gaps preserved, out-of-bounds notes reported. This fully informs the agent about side effects and edge cases.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with an opening purpose, mode explanations, and a returns section. It is reasonably concise given the complexity, though the arg list is somewhat repetitive with the schema definitions.

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?

With 13 parameters and no output schema, the description leaves major gaps: filtering mechanism, what 'targeted note' means, and the role of return_notes are unclear. An agent cannot confidently construct a correct call without additional documentation.

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

Parameters2/5

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

Schema coverage is 0%, and the description explains only 4 of 13 parameters (mode, voice, max_gap_beats, length_beats). Critical targeting parameters like track_index, item_index, fields, channel, pitch range, and start/end beat are entirely unaddressed, leaving the agent guessing how to select notes.

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 operation (closing gaps or setting fixed lengths) on a MIDI line, with a clear verb and resource. It distinguishes itself from siblings like quantize, stretch, and humanize by focusing on note ends and legato behavior.

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

Usage Guidelines4/5

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

It explains when to use 'connect' vs 'fixed' modes and clarifies the voice parameter's role in chordal vs per-pitch processing. However, it does not explicitly mention alternatives or when not to use this tool versus other MIDI editing tools.

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

Deploy Server

Other Tools