Skip to main content
Glama
wegitor
by wegitor

add_midi_notes

Add multiple MIDI notes to a REAPER MIDI item in one operation, with per-note pitch, timing, and velocity settings.

Instructions

Add multiple MIDI notes to a MIDI item in one operation.

Important: Please check MIDI item length in which you want to add notes. If any note extends beyond the item bounds, create another one or resize existing before note adding.

Item Identification - TWO ways to specify which item:

  1. Using track_pos_idx (integer):

    • Simple position number: 0 = first item, 1 = second item, etc.

    • Get this from create_midi_item response field "track_pos_idx"

    • Quick but may become invalid if items are deleted/reordered

  2. Using direct_item_id (string):

    • REAPER's internal pointer like "MediaItem*0x000001234567890A"

    • Get this from create_midi_item response field "direct_item_id"

    • Or from get_items_in_time_range response

    • Guaranteed to always point to the same item

Recommendation: Use track_pos_idx for quick scripts, direct_item_id for reliability.

Args: track_index: Index of the track track_pos_idx: EITHER integer track_pos_idx OR string direct_item_id notes: List of note definitions, each containing: - pitch: MIDI note pitch (0-127) - start_time: Start position in seconds (optional if start_measure provided) - start_measure: Start position as "measure:beat,fraction" (optional if start_time provided) - length_time: Duration in seconds (optional if length_measure provided) - length_measure: Duration as "measure:beat,fraction" (e.g., "0:2,000" = 2 beats) - velocity: Note velocity (0-127, optional, default: 96) - relative_start: Default mode for all notes. Per-note override supported via note['relative_start'] (bool).

Example: notes = [ { "pitch": 60, "start_measure": "1:1,000", "length_measure": "0:2,000", "velocity": 100 }, { "pitch": 64, "start_time": 2.5, "length_time": 0.5 } ]

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemYes
notesYes
track_indexYes
relative_startNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It explains that track_pos_idx 'may become invalid if items are deleted/reordered,' discloses the default relative_start behavior, and warns about extending notes beyond item bounds. It doesn't mention error handling or reversibility, but the key behavioral traits are covered 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.

Conciseness4/5

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

The description is well-organized with bold sections, bullet points, and a concrete example. It is longer than strictly necessary, but the structure makes it easy to scan. Every major section earns its place, though the Args list could have been more succinctly mapped to the actual parameter names.

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?

The tool has an output schema (not shown), so return values don't need explanation. The description covers item identification, parameter formats, and critical constraints (item length). It lacks details about atomicity, partial failure behavior, or how the track_index relates to item extraction, but for a MIDI editing tool, the description is quite complete.

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

Parameters3/5

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

The description compensates for 0% schema coverage with extensive parameter details, including note fields (pitch, start_time, length_measure, etc.) and an example. However, there is a significant naming mismatch: the schema declares a parameter named 'item,' but the description's Args section refers to 'track_pos_idx' as the parameter name. This could confuse the agent about which schema field to populate. Additionally, relative_start is only mentioned as a per-note override, not clearly as a top-level parameter.

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 begins with a specific verb and resource: 'Add multiple MIDI notes to a MIDI item in one operation.' It clearly distinguishes itself from the sibling tool add_midi_note (singular) by emphasizing 'multiple' and 'one operation.' This provides unambiguous purpose and scope.

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 gives explicit usage guidance, including an important prerequisite warning about checking MIDI item bounds before adding notes. It also details two item identification methods and recommends when to use each: 'Use track_pos_idx for quick scripts, direct_item_id for reliability.' This is clear when-to-use guidance with alternatives.

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

Install Server

Other Tools

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/wegitor/reaper-reapy-mcp'

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