Skip to main content
Glama
Strudel MCP Server

Strudel MCP Server

import_midi

Converts a .mid file from base64 data or the patterns/midi directory into a playable Strudel pattern, separating drum and pitched tracks for immediate playback.

Instructions

Convert a .mid file into a playable Strudel pattern (Phase 1: literal transcription, #201). Use source="base64" with data= for inline bytes, or source="path" with data= to read from the patterns/midi/ directory (path traversal blocked). Drum tracks (MIDI channel 10) emit one s() lane per sample so simultaneous kicks/hats do not collide. Pitched tracks emit note("...").s("piano") with simultaneous notes merged into [a,b,c] chord tokens. Phase 2+ (structural compression, voice separation, LLM idiomatic pass) tracked in separate issues. Example: import_midi({ source: "path", data: "drumloop.mid", steps_per_cycle: 16 }). For the reverse direction (Strudel → MIDI) use the export_midi tool.

Input Schema

NameRequiredDescriptionDefault
barsNoCap on bars to emit. Default: full file.
dataYesFor source=base64: base64-encoded .mid bytes (≤1MB decoded). For source=path: basename of a .mid file under ./patterns/midi/ (path-traversal blocked).
sourceYesHow to interpret `data` — raw base64 bytes or a filename under patterns/midi/
drum_mapNoOptional override / extension to the default GM percussion map. Keys are MIDI note numbers (as strings, since JSON object keys), values are Strudel sample names. Example: { "60": "cp", "61": "rim" }. Unmapped drums fall back to rests and are surfaced in the result summary.
steps_per_cycleNoGrid resolution per bar (integer 1-64). Default 16.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv4.0.0

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does substantial work: it discloses the Phase 1 literal-transcription scope, channel-10 drum lane splitting, note("...").s("piano") emission for pitched tracks, chord-token merging, and that path traversal is blocked. What it omits is the shape of the return value (the schema mentions a 'result summary' but the description never says what is returned on success or failure).

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 core purpose, then modes, then emission semantics, then the alternative tool — a sensible ordering. The Phase 2+ roadmap sentence and the '#201' issue reference are internal noise that an agent gains nothing from, though they cost only one sentence.

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 converter with five parameters (including a nested drum_map) and no output schema, the description covers the important behavioral questions: how drums vs pitched tracks are rendered and what limits path input. The remaining gap is the return contract — whether the tool returns a pattern string, an object, or a summary with unmapped drums — which the agent must discover empirically.

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; the description adds genuine meaning by tying source values to concrete data semantics ('data=<base64 string>' vs 'data=<basename>') and by showing steps_per_cycle in a realistic call. The drum_map override and bars cap are left entirely to the schema, which is acceptable given full coverage.

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 ('Convert a .mid file into a playable Strudel pattern') and immediately distinguishes itself from the sibling export_midi by naming the reverse-direction tool. An agent can tell what this does and what it does not do without opening the schema.

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?

Gives explicit conditional guidance for the two source modes (base64 for inline bytes, path for files under patterns/midi/) and names the alternative tool for the opposite direction. The inline example with source="path" anchors the intended invocation pattern.

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