Skip to main content
Glama

midi

Compose music by describing notes, chords, dynamics, and tempo, then render to standard MIDI files. Converts musical intent into playable MIDI output.

Instructions

Execute midi operations. Each op string follows: VERB TARGET [key:value ...] Call midi_help for the full reference card.

MUSIC: note TRACK PITCH at:POS dur:DUR [vel:V] [ch:N] chord TRACK SYMBOL at:POS dur:DUR [vel:V] [ch:N] track add|remove NAME [instrument:INST] [program:N] [ch:N] [bank:MSB[.LSB]] cc TRACK CC_NAME VALUE at:POS [ch:N] bend TRACK VALUE at:POS [ch:N] tracker TRACK import at:POS [res:RES] ... tracker end

STATE: mute TRACK solo TRACK program TRACK INSTRUMENT|program:N [at:POS] [bank:MSB[.LSB]]

META: tempo BPM [at:POS] time-sig N/D [at:POS] key-sig KEY-MODE [at:POS] marker TEXT at:POS title TEXT

EDITING: remove SELECTORS move SELECTORS to:POS copy SELECTORS to:POS transpose SELECTORS SEMITONES velocity SELECTORS DELTA quantize SELECTORS grid:DUR modify SELECTORS [pitch:P] [vel:V] [dur:D] [at:POS] [ch:N] repeat SELECTORS [to:POS] count:N crescendo SELECTORS from:VEL to:VEL decrescendo SELECTORS from:VEL to:VEL

SELECTORS: @track:NAME @channel:N @range:M.B-M.B @pitch:PITCH @velocity:N-M @all @recent @recent:N @not:TYPE:VALUE Combine to intersect: @track:Piano @range:1.1-4.4

POSITION: M.B (1.1 = start) M.B.T (tick offset) tick:N +DUR -DUR end

DURATION: whole, half, quarter, eighth, sixteenth, 32nd 1n, 2n, 4n, 8n, 16n, 32n dotted-quarter, triplet-eighth, ticks:N

PITCH: C4, D#5, Bb3 (note+accidental+octave) midi:60 (raw MIDI number)

CHORDS: Cmaj, Am, Dm7, G7, Bdim, Faug, Csus4, Asus2 Cmaj7, Am7, Dm7b5, G9, Cm6, Cadd9, Dm/F (slash)

VELOCITY: 0-127 (numeric) ppp, pp, p, mp, mf, f, ff, fff (dynamic names)

CC NAMES: volume, pan, modulation, expression, sustain, reverb, chorus, brightness, portamento, breath

GM INSTRUMENTS (EXAMPLES): acoustic-grand-piano, electric-piano-1, vibraphone acoustic-guitar-nylon, electric-bass-finger, violin trumpet, alto-sax, flute, string-ensemble-1 program:N (raw 0-127) bank:MSB[.LSB]

RESPONSE PREFIXES:

  • note/chord added ~ event modified

  • track modified - event removed ! meta event @ bulk operation

CONVENTIONS:

  • Positions are 1-based: measure 1, beat 1 = 1.1

    • Channels are 1-indexed user-facing (ch:1 through ch:16)

    • Channel 10 is drums (GM standard)

    • Track names are unique identifiers

    • Batch multiple ops in one call for efficiency

    • Call midi_help after context truncation for full reference

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
opsYes
Behavior4/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It does well by documenting response prefixes, 1-based positions, 1-indexed channels, and GM conventions. It stops short of explaining failure modes, transactionality of batched ops, or persistence behavior, which are relevant for an execution tool.

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 long but meticulously organized into labeled sections (MUSIC, STATE, META, EDITING, SELECTORS, etc.) with a monospaced format for readability. The front-loaded instruction 'Each op string follows: VERB TARGET [key:value ...]' and the pointer to midi_help ensure efficiency. Every section provides essential syntax for a complex DSL, so no space is wasted.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity, the absence of an output schema, and zero annotations, this description is remarkably complete. It covers all major operation types, selectors, notational conventions, and response prefixes. It also references midi_help for deeper coverage, making it sufficient for correct tool invocation.

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?

The schema has a single undocumented parameter 'ops' (an array of strings), and the description fully compensates by defining the exact op syntax, selectors, positions, durations, pitches, chords, velocities, and more. This is a comprehensive semantic specification that makes parameter usage unambiguous.

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?

The description opens with 'Execute midi operations,' a clear verb+resource statement that identifies the tool's core purpose. It also differentiates from midi_help by instructing users to call it for the full reference card. However, it does not explicitly contrast with midi_query or midi_session, so it doesn't fully distinguish among all sibling 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?

The description offers some usage guidance, such as batching multiple ops for efficiency and calling midi_help when context is truncated. However, it does not explicitly state when to use this tool instead of midi_query or midi_session, and the guidance is mostly implied through the operation list.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/os-tack/fcp-midi'

If you have feedback or need assistance with the MCP directory API, please join our Discord server