Skip to main content
Glama

set_midi_note

Edit an existing MIDI note's pitch, start, length, or channel in REAPER. Only the fields you pass change, so use it to adjust notes without recreating them.

Instructions

Edit one existing MIDI note in place: pitch, start, length and/or channel. Only the fields you pass change, and at least one is required. (Velocity: set_midi_note_velocity.)

note_index is REAPER's PPQ-sorted index from get_midi_notes / get_selected_midi_notes and is unstable - re-read after the edit, since the returned list reflects the new order.

Args: pitch: New pitch (0-127). start_beat: New start in beats from item start; length is preserved. A start before the item start clamps there and is counted in out_of_bounds, not clamped. length_beats: New length in beats (> 0), resized from the current start. channel: New MIDI channel (0-15).

Returns: {ok, notes_changed, clamped, skipped, out_of_bounds, notes:[...]}, or {ok:false, error} for a bad index, an empty edit, or an out-of-range value (nothing is written).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pitchNo
fieldsNo
channelNo
item_indexYes
note_indexYes
start_beatNo
track_indexYes
length_beatsNo
return_notesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.7.3

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations, the description carries the whole burden and does so: it discloses in-place mutation semantics, the unstable PPQ-sorted index and the need to re-read after editing, clamping behavior for starts before the item start (counted in out_of_bounds rather than silently clamped), and that a bad index, empty edit, or out-of-range value writes nothing. That is a complete safety and outcome profile for a mutation tool.

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?

Front-loads the core action, then the index-stability caveat, then per-argument and return details. Every sentence earns its place and there is no redundant restatement of the name or title.

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

Completeness4/5

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

There is no output schema and no annotations, and the description compensates by enumerating the return shape ({ok, notes_changed, clamped, skipped, out_of_bounds, notes}) and the failure shape. It falls just short of complete because the 'fields' argument is undocumented and the tool has nine parameters at 0% schema coverage.

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 description coverage is 0%, so the description must compensate, and it adds real meaning: ranges (pitch 0-127, channel 0-15), length must be > 0 and resizes from the current start, start_beat is measured in beats from item start with length preserved, and note_index is REAPER's unstable PPQ-sorted index. However, the 'fields' parameter is never mentioned and track_index/item_index are left implicit, so one of nine parameters remains entirely unexplained.

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?

States a specific verb and resource ('Edit one existing MIDI note in place') and enumerates the editable fields (pitch, start, length, channel). It explicitly delineates itself from set_midi_note_velocity, so an agent can separate this from sibling note-mutation tools without reading a schema.

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?

Explains the partial-update contract ('Only the fields you pass change, and at least one is required') and routes the excluded concern, velocity, to set_midi_note_velocity. It does not contrast with other note editors such as transpose_midi_notes, nudge_midi_notes, or quantize_midi_notes, so an agent choosing between bulk and single-note edits gets partial guidance.

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