Skip to main content
Glama

Import a MIDI file

import_midi
Destructive

Import a Standard MIDI File (.mid) into a Lathe song as MIDI clips, placing the whole file on a selected MIDI track or creating new tracks for each part while preserving note timing.

Instructions

Puts a Standard MIDI File (.mid) from the computer into the song as MIDI clips, like dragging it onto Lathe's arrangement: a groove from a drum library, a part exported from another program. Use this instead of reading a file and writing its notes out. With track (a MIDI track), the whole file goes onto it as one clip, clearing whatever was there in those bars. Without track, each part of the file (a track of it, or a channel of a one-track file) gets a new MIDI track named after it, or one new track with one_track; new tracks have no instrument, so add one with edit_session. Clips run to the end of the bar their last note ends in. Notes keep their place in beats: the song's tempo is not changed (the reply gives the file's tempo and time signature, so you can match them with edit_session). One undo step.

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": {
      "path": "<path>"
    },
    "name": "import_midi"
  }
}

Input Schema

NameRequiredDescriptionDefault
barNoWhere it starts (1-based bar, default 1)
pathYesThe .mid file: a full path or ~/...
trackNoA MIDI track (name or id) to put it all on. Without it: new tracks
one_trackNoWithout track: put every part on one new track (default false)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior3/5

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

Adds substantial behavior beyond the annotations: imported clips overwrite existing content in those bars (consistent with destructiveHint=true), it is a single undo step, notes keep their beat positions and the song tempo is not changed, and the reply reports the file's tempo and time signature. However, these facts are stated as outcomes rather than as a coherent risk/permission profile, and the destructive scope is only implied by the phrase about clearing bars; with annotations already flagging destructive and non-idempotent, the description adds context but not a full behavioral picture for a mutation.

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-loads what the tool does, then behavior, then caveats; most sentences carry real information. The illustrative asides ("a groove from a drum library, a part exported from another program") are minor filler in an otherwise dense but readable block.

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?

No output schema exists, and the description compensates by telling the agent what the reply contains (file tempo and time signature) and how to act on it. Combined with the track/one_track modes, overwrite behavior, and undo semantics, an agent has everything needed to invoke it correctly.

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 genuinely adds semantics the schema does not: track causes the whole file to land as one clip and clears prior content in those bars, while omitting track spawns new tracks per part, and one_track is defined in relation to that absence. It leaves bar's interaction only implicitly covered by the closing note about clips running to the end of the bar.

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 concrete verb and resource ("Puts a Standard MIDI File (.mid) from the computer into the song as MIDI clips") and anchors it with an analogy to dragging into the arrangement. It also distinguishes the tool from the manual alternative (reading a file and writing notes out), so an agent can separate it from write_notes/convert_to_midi.

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 prescribes when to use this instead of the file-read-plus-write_notes path, and lays out the two operating modes: with track (whole file onto one clip) vs without track (one new track per part, or one_track for a single new track). It also tells the agent what follow-up is needed (add an instrument with edit_session).

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