Skip to main content
Glama

cw_write_midi_file

Writes a Standard MIDI File (format 1) from note and CC events so you can place notes and set track channel, initial volume, and pan for reliable SONAR imports.

Instructions

Generate a Standard MIDI File (format 1) from note and CC events. Each track needs a MIDI channel; CC7/CC10 written at tick 0 become that track's initial volume and pan when SONAR imports the file. This is the reliable way to set mixer values and place notes, because the in-app controls are read-only through automation on this build.

Input Schema

NameRequiredDescriptionDefault
bpmNo
pathYesWhere to write the .mid
tracksYes
overwriteNoReplace an existing file. Without this, writing over a path that already exists is refused

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations, the description carries real weight and does disclose non-obvious behavior: format 1 output, a required channel per track, and the SONAR import rule that CC7/CC10 at tick 0 become initial volume/pan. It omits what a successful call returns and how failures are surfaced, so the mutation/write profile is only partially covered.

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 sentences, front-loaded with the artifact produced, followed by the key semantic constraint and the usage rationale. No filler; the only mild redundancy is restating the mixer-value use case after the CC7/CC10 explanation.

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 file-writing tool with no annotations and no output schema, the description should say what the call returns or how to confirm the file was written. It covers purpose and import semantics well but leaves success/failure signaling and the overwrite-refusal behavior entirely to the schema.

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 coverage is 50%, so the description must compensate. It adds genuine meaning for 'channel' ('Each track needs a MIDI channel') and for volumeCC/panCC (tick-0 CC7/CC10 becoming mixer values on import), but leaves bpm, the -1..+1 pan alternative, raw 'events' bytes, and program unexplained in prose.

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 artifact: 'Generate a Standard MIDI File (format 1) from note and CC events.' That is precise enough to separate it from the note/CC senders (cw_midi_note, cw_midi_cc) and from cw_read_midi_file, but it never names a sibling or explicitly contrasts the write path with the read path.

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 final sentence gives a clear when-to-use rule: this is 'the reliable way to set mixer values and place notes, because the in-app controls are read-only through automation on this build.' That effectively routes the agent away from cw_set_track_volume/cw_set_track_pan, though those tools are never named and no explicit 'do not use this when...' boundary is drawn.

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