Skip to main content
Glama

remove_overlapping_midi_notes

Destructive

Resolve overlapping MIDI notes on the same pitch and channel by trimming earlier notes or deleting quieter ones to clean up your MIDI track.

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

A3.7/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true, and the description adds substantial context: what gets removed, how 'trim' vs 'delete' resolve conflicts, how exact-onset stacks collapse, and how short trims are handled. It also discloses the return structure and edge-case behavior, far exceeding what annotations alone provide.

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 front-loaded with purpose and conflict rules, then systematically covers modes, edge cases, arguments, and returns. Despite its length, every sentence carries useful information for a complex 11-parameter tool, with no filler.

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

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description compensates for the lack of an output schema by describing the return object and covers behavioral nuances well. However, it leaves several parameters undocumented, including required track_index and item_index, so the definition is not fully self-contained for invocation.

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 11 parameters exist, but the description documents only mode, min_length_beats, pitch_low, and pitch_high. Required parameters track_index and item_index are never explained, nor are channel, start_beat, end_beat, fields, or return_notes, leaving significant gaps.

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

Purpose4/5

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

The description states a specific verb and resource: 'Clean up overlapping MIDI notes.' It clearly conveys that this tool resolves same-pitch note collisions, which is distinct from general MIDI editing siblings. However, it does not name or contrast with any sibling tool, so it lacks explicit sibling differentiation.

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

Usage Guidelines3/5

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

The description defines the condition under which notes conflict (same pitch, channel, and time overlap), which implies when the tool is applicable. It does not state when to use this tool instead of manually editing notes or using sibling tools, nor does it provide explicit exclusions beyond the conflict definition.

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