Skip to main content
Glama

Write MIDI notes

write_notes
Destructive

Writes MIDI notes into a Lathe track across chosen bars from pattern notation or a JSON note list, with replace/add modes and repeat, as one undoable edit.

Instructions

Writes notes into a MIDI track, as one undo step in Lathe. Give pattern (Lathe's note notation; notation_guide has the full reference) or notes (a JSON list). A pattern is lines; each loops to fill from_bar to to_bar. Drum grid: a lane then one character per step (16ths by default; . rest, x hit, X accent, o ghost, 1-9 velocity levels), e.g. "kick x... ..x. x... ....". Token line: notes split each bar evenly (| between bars; ~ rest, _ hold, [a b] share a step, [a,b] chord), each with optional :velocity, +8ms/-5ms or +20% timing, =beats length, e.g. "bass: c2:110 ~ [c2 c2:70-6ms] ~ | f1=2 _ ~ g1+4ms". "swing 58%" and "humanize 6ms 8vel seed 3" lines set the feel for the lines after. The notes go in a clip covering from_bar to to_bar: with mode "replace" (the default) whatever was in those bars on that track goes first; with "add" they join the notes already there. Every note must start inside the bars. repeat plays the notes again that many times back to back (a one-bar beat with repeat 4 fills four bars). Lathe's Drums play the usual drum notes: 36 kick, 37 rim, 38 snare, 39 clap, 42 closed hat, 46 open hat, 41/45/48 low/mid/high tom, 49 crash, 51 ride, 56 cowbell.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "track": "<track>",
      "from_bar": "<from_bar>",
      "to_bar": "<to_bar>"
    },
    "name": "write_notes"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeNo"replace" (default) or "add"
notesNoThe notes as a list, instead of pattern (at most 4000 with the repeats)
trackYesMIDI track name or id
repeatNoPlay the notes this many times in a row, each copy (to_bar - from_bar) bars later, and make the clip that much longer (default 1)
to_barYesWhere it ends: from_bar 1, to_bar 2 is one bar
patternNoThe notes in Lathe's note notation (instead of notes)
from_barYesWhere the clip starts (1-based bar)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, readOnlyHint=false, and idempotentHint=false, and the description adds real value on top: it names the undo granularity ("one undo step"), the replace-vs-add effect on existing bar content, the repeat expansion of clip length, and the 4000-note ceiling. The key destructive behavior is under-sold, though — "whatever was in those bars on that track goes first" is ambiguous phrasing for what is actually deletion/overwrite of existing notes.

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?

Front-loaded with the verb and resource in the first clause, then the two input paths, then syntax detail. It is dense and long, and a chunk of the notation grammar arguably duplicates notation_guide, which the description itself points to — but the ordering is logical and no sentence is pure 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 7-parameter destructive write tool with no output schema, the description covers inputs, destructive semantics, repeat behavior, and even drum pitch mapping. The remaining gap is what the call returns and whether the target track must already exist, which matters for a non-idempotent mutation.

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 100%, so the baseline is 3, but the description goes beyond the schema by explaining how pattern syntax maps to musical output (lanes, steps, holds, chords, velocity/timing suffixes, swing and humanize lines) and by making 'repeat' concrete ("a one-bar beat with repeat 4 fills four bars"). It also clarifies that notes must start inside from_bar/to_bar, a constraint the schema does not express.

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 ("Writes notes into a MIDI track") and immediately distinguishes the two mutually exclusive input paths (pattern vs notes). It also flags the relationship to a sibling ('notation_guide has the full reference'), so an agent knows where to go for deeper syntax rather than confusing the two tools.

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?

Usage is only implied: the description explains what each input mode does but never states when to choose this tool over alternatives such as convert_to_midi, import_midi, or edit_session, nor any prerequisites (does the track need to exist?). The pattern-vs-notes choice is the only explicit either/or guidance.

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