Skip to main content
Glama

insert_midi_file

Insert a .mid file onto a REAPER track at a chosen position. Write MIDI externally, then add it without overwriting existing items unless replace is enabled.

Instructions

Insert a .mid file from disk onto a track at a position. Write the MIDI yourself, then insert. Never overwrites existing items unless replace_existing_in_range is true.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
loopNo
trackNoExact track name (case-insensitive).
lengthNo{type: bars|region|time_selection|seconds|as_generated, ...}
dry_runNoPreview: return what would run without changing the project.
positionNoPosition object, e.g. {"type":"cursor"}, {"type":"bar","bar":33}, {"type":"time","seconds":12.5}, {"type":"marker","name":"Chorus"}, {"type":"region","name":"Verse 1"}, {"type":"time_selection"}
midi_pathYesAbsolute path to the .mid file.
track_containsNoCase-insensitive substring; errors if it matches more than one track.
target_track_guidNoStable REAPER track GUID; preferred when available.
use_selected_trackNoTarget the currently selected track instead of naming one.
replace_existing_in_rangeNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description carries the full burden and does disclose one meaningful behavioral trait: it 'Never overwrites existing items unless replace_existing_in_range is true', which is not derivable from the bare boolean schema. It omits other mutation-relevant behavior such as error handling on ambiguous track names, permission/save-state requirements, and what a dry_run returns.

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?

Three short sentences, front-loaded with the core action and followed by the precondition and the destructive-behavior guard. Nothing is padded, though the middle sentence ('Write the MIDI yourself, then insert') is slightly awkward advice rather than specification.

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?

For a 10-parameter mutating tool with nested objects, no annotations, and no output schema, the description covers purpose, precondition, and the one destructive toggle. It still leaves gaps around error behavior, interaction with dry_run, and the fact that only one parameter is required, so it is adequate but not complete.

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 coverage is already 80% and most params (track, position, length, midi_path) are self-documenting, so the baseline would be 3. The description adds real value by explaining the semantics of replace_existing_in_range (the only way items in range get destroyed), which the schema leaves as a bare boolean.

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?

States a specific verb and resource ('Insert a .mid file from disk onto a track at a position'), plus the source and destination, so the agent knows exactly what the call does. It does not, however, explicitly distinguish itself from close siblings such as insert_midi_events, insert_riff, or insert_groove, which an agent must infer from the file-on-disk framing.

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?

'Write the MIDI yourself, then insert' implies the required precondition (a .mid file already exists on disk and is passed via midi_path). That is useful context, but there is no statement of when to choose this over insert_midi_events or how it relates to dry_run/verify_change, so routing guidance is only implied.

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