Skip to main content
Glama

insert_midi_file

Insert a .mid file from disk onto a track at a chosen position. Overwrites existing items only when replace_existing_in_range 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. Use this when a .mid file already exists; to build MIDI from a list of notes use insert_midi_events, for humanized drums insert_groove, for guitar or bass insert_riff.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
loopNo
trackNoExact track name (case-insensitive); "master" targets the master track. Used when no GUID is given; errors if two tracks share the name.
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; used only when no GUID or exact name is given. Errors if it matches more than one track.
target_track_guidNoStable REAPER track GUID; preferred when available. Wins over every other track selector.
use_selected_trackNoTarget the first selected track; ignored when any other track selector is given. Errors if nothing is selected.
replace_existing_in_rangeNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv3.21.0
    • changedInput schema / properties / target_track_guid / description
      Previous value: -"Stable REAPER track GUID; preferred when available."New value: +"Stable REAPER track GUID; preferred when available. Wins over every other track selector."
    • changedInput schema / properties / track / description
      Previous value: -"Exact track name (case-insensitive)."New value: +"Exact track name (case-insensitive); \"master\" targets the master track. Used when no GUID is given; errors if two tracks share the name."
    • changedInput schema / properties / track_contains / description
      Previous value: -"Case-insensitive substring; errors if it matches more than one track."New value: +"Case-insensitive substring; used only when no GUID or exact name is given. Errors if it matches more than one track."
    • changedInput schema / properties / use_selected_track / description
      Previous value: -"Target the currently selected track instead of naming one."New value: +"Target the first selected track; ignored when any other track selector is given. Errors if nothing is selected."
  2. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the behavioral burden and it discloses the most important side effect: existing items are never overwritten unless replace_existing_in_range is true. It also clarifies that the tool inserts rather than generates MIDI. It does not describe return values or error cases, so it is not a perfect 5.

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?

Three short sentences, each purposeful: the action, the overwrite caveat, and the routing to alternatives. The most important guidance is front-loaded before the sibling list.

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?

For a 10-parameter tool with no annotations and no output schema, the description is concise but covers the core call path, the safety behavior, and sibling selection. It leaves some details, such as default position and return value, to the schema or inference, but the essential decisions an agent must make are all represented.

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?

Schema description coverage is 80%, so the schema carries most parameter documentation; the description adds value by clarifying replace_existing_in_range, which otherwise lacks a schema description. It does not explain loop or default behavior for position, but the high schema coverage keeps this at baseline 3.

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 action and object: inserting an existing .mid file from disk onto a track at a position. It also differentiates from siblings by noting the file must already exist ('Write the MIDI yourself') and by naming alternative tools for generated, humanized, or guitar/bass content.

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?

Explicitly tells the agent when to choose this tool: when a .mid file already exists on disk. It names insert_midi_events, insert_groove, and insert_riff as alternatives with their exact conditions, leaving no ambiguity about routing.

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