Skip to main content
Glama

insert_groove

Render a drum DSL to MIDI and insert it on a REAPER track in one call, with humanized velocity, fatigue, and timing. Supports dry-run preview.

Instructions

Render a drum DSL to MIDI and insert it on a track in ONE call — the engine (skills/drum-apparatus/) humanizes velocity, fatigue and timing at placement. Give the DSL EITHER inline as dsl_text OR as a file with dsl_path, never both. MUTATES the project (undo-block wrapped, one Ctrl/Cmd+Z reverts); supports dry_run. Refuses in ~0 s when the bridge heartbeat is dead, before generating anything. The rendered .mid is KEPT under rendered-midi/ — REAPER imports MIDI by reference on this build, so a deleted render leaves an empty take. Kit map: the DSL's own @map wins, then this map argument, then drum-config.json, then GM Standard. Track: named track, else drum-config.json's default, else REAPER's selected track. A bad DSL comes back as DSL_ERROR with the engine's own message — fix the DSL from it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
mapNoDrum-kit map name (see reaperd.py list-maps). The DSL's @map wins over this.
seedNoRNG seed for the humanizer; same seed + same DSL = same MIDI.
trackNoExact track name (case-insensitive); "master" targets the master track. Used when no GUID is given; errors if two tracks share the name.
dry_runNoPreview: return what would run without changing the project.
dsl_pathNoAbsolute path to a .dsl file. Mutually exclusive with dsl_text.
dsl_textNoThe groove DSL inline. Mutually exclusive with dsl_path.
positionNoWhere to insert: a position object like {"type":"bar","bar":33} (see insert_midi_file) or a plain number of seconds. Default: the edit cursor.
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.

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.7/5.0
Behavior5/5

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

With no annotations, the description carries the full behavioral burden and does so thoroughly. It discloses that the tool MUTATES the project, wraps changes in an undo block, preserves rendered .mid files because REAPER imports by reference, refuses when the bridge heartbeat is dead, and explains the kit-map precedence chain.

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 dense but front-loaded with the core action, then organizes constraints and precedence into connected clauses. Every sentence adds operational value: mutation safety, dry-run, render persistence, kit-map resolution, track selection, and error handling. Nothing is filler.

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, mutation-heavy tool with no output schema, the description is remarkably complete: it covers failure modes, render persistence, track resolution, and precedence. The only notable gap is the success return shape; the agent knows errors return DSL_ERROR but not what a successful insertion returns.

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

Parameters5/5

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

Although schema coverage is 100%, the description adds critical semantics: dsl_text and dsl_path are mutually exclusive, same seed plus same DSL produces identical MIDI, target_track_guid wins over other selectors, and use_selected_track is ignored when another selector is present. These details go well beyond the raw parameter descriptions.

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 opens with a specific verb and resource: 'Render a drum DSL to MIDI and insert it on a track in ONE call.' This clearly distinguishes the tool from siblings like insert_midi_file and insert_midi_events, which operate on already-existing MIDI or event data rather than a drum DSL.

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?

The description gives clear operational context: DSL must be provided either inline or via file, 'never both'; dry_run is supported; track selection precedence is spelled out; and errors like DSL_ERROR are explained. It does not explicitly contrast this tool against sibling insertion tools, but the DSL-specificity and reference to insert_midi_file for position semantics provide enough guidance.

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