Skip to main content
Glama

remove_overlapping_midi_notes

Destructive

Clean up overlapping MIDI notes on the same pitch and channel by trimming earlier notes or deleting quieter ones, leaving chords and non-conflicting notes untouched.

Instructions

Clean up overlapping MIDI notes (same pitch stacked on itself).

Two notes conflict only if they share a pitch AND a channel AND overlap in time, so a chord is never a conflict and notes that merely touch are left alone. "trim" shortens the earlier note to stop where the next begins, losing nothing; "delete" drops one note of each overlapping pair, keeping the louder (ties go to the longer note).

Either mode can remove notes: notes stacked on the exact same onset collapse to the loudest, since there is nothing to trim between them, and a trim left shorter than min_length_beats is removed rather than left as a click.

Args: mode: "trim" (shorten the earlier note) or "delete" (drop the quieter note). min_length_beats: A trimmed note left shorter than this is removed instead. Default 1/128 of a beat; 0 disables it. pitch_low, pitch_high: Notes outside the filter are invisible: never touched, and never counted as an overlap partner.

Returns: {ok, mode, notes_changed, clamped, skipped, out_of_bounds, notes_removed, trimmed, deduped, deleted, notes:[...]} where notes_removed = deduped + deleted.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNotrim
fieldsNo
channelNo
end_beatNo
pitch_lowNo
item_indexYes
pitch_highNo
start_beatNo
track_indexYes
return_notesNo
min_length_beatsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.7.3

TDQS

A4.1/5.0
Behavior5/5

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

Beyond the destructiveHint annotation, the description discloses substantial behavioral detail: both modes can remove notes, same-onset stacks collapse to the loudest, trimmed notes shorter than min_length_beats are removed, and pitch filtering makes notes invisible to the operation. It also explains the return counters and the relationship notes_removed = deduped + deleted.

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: a one-line purpose, a precise conflict rule, mode semantics, edge-case behavior, an Args list, and a Returns summary. Every sentence contributes meaningful information and the structure makes the long parameter list navigable.

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?

Although the core overlap behavior and return shape are thoroughly explained, the description omits several parameters that affect invocation, including the required track_index/item_index, channel filtering, start/end beat bounds, fields, and return_notes. For an 11-parameter destructive tool with no output schema, this is a significant completeness gap.

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?

With 0% schema description coverage, the description must document parameters, but it only explains mode, min_length_beats, and pitch_low/pitch_high. The required track_index and item_index, plus channel, fields, start_beat, end_beat, and return_notes, are left undocumented, so an agent cannot fully determine how to invoke the tool correctly.

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 ('Clean up overlapping MIDI notes') and precisely defines what counts as a conflict (same pitch AND channel AND time overlap), which distinguishes it from sibling MIDI editing tools. It also clarifies what is not a conflict (chords, touching notes), leaving no ambiguity about scope.

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?

The description gives clear applicability context by defining the exact overlap condition and explaining the two modes, so an agent can determine when this tool fits. It does not explicitly name alternatives or state when not to use it, but the conflict definition effectively scopes the tool.

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