Skip to main content
Glama
libsonare-mcp

libsonare-mcp

Official
by libraz

Edit MIDI notes

midi_edit
Destructive

Transform existing MIDI notes with ordered operations such as transpose, quantize, humanize, arpeggiate, and groove, then write a new .mid or update a project file.

Instructions

Transforms notes with an ordered list of operations: transpose (semitones, interval, or to a key), quantize with swing, humanize, change velocity, filter notes, fold into an instrument range, invert or reverse, arpeggiate, and apply the groove of another file; on a .mid file or inline tracks also merge tracks, split a track by pitch, retime, set one tempo and set the program. A project file is rewritten in place (or into 'output'); a .mid file or inline tracks give a new .mid. Use it for any change to existing notes; pass 'track' to touch one track, and drums are skipped by transpose, transform, arpeggiate, foldToRange, splitByPitch and setProgram. Track, tempo and program changes on a project belong to project_edit (addTrack, setTempoSegments, setProgram). Not for reading (use midi_read). Example: {"source": "song.mid", "ops": [{"op": "transpose", "shift_semitones": -2}, {"op": "quantize", "grid": "1/16", "strength_ratio": 0.8}]}.

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": {
      "source": "<source>",
      "ops": "<ops>"
    },
    "name": "midi_edit"
  }
}

Input Schema

NameRequiredDescriptionDefault
opsYesOperations applied in order, each an object with an 'op' name plus its fields (1-64). Drum tracks are skipped by transpose, transform, arpeggiate, foldToRange, splitByPitch and setProgram. mergeTracks, splitByPitch, retime, setTempo and setProgram need a .mid file or inline tracks.
trackNoEdit only this track: its id (integer from 1) or its unique name. Omit to edit every track.
detailNo'concise' returns the summary and the most useful fields; 'full' returns all.concise
outputNoOutput .mid path. Omit to auto-name a file in the output directory.
sourceYesWhat to edit. A .mid file or inline tracks give a new .mid; a project file is rewritten in place (or into 'output', a .sonare.json) and each edited track must have one MIDI clip. A .mid/.midi file path, a project file path (.sonare.json) or inline tracks [{name?, program?, channel?, is_drum?, notes: [{pitch, start_ppq, length_ppq, velocity}]}]. Track ids of a file are the core's (1, 2, ...); inline tracks count from 1.
dry_runNoReport what would be written, with the planned path, only.
overwriteNoReplace an existing file at 'output' (default false).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already flag destructiveHint=true and readOnlyHint=false, so the safety profile is covered; the description adds the non-obvious consequence that a project file is rewritten in place while a .mid or inline source produces a new .mid. It also discloses that drum tracks are silently skipped by six specific ops, which is a real behavioral trap no annotation captures. It does not mention overwrite/dry_run safety valves in the prose, but those are fully documented in the schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

It is front-loaded with the core purpose and the key alternative routing, but the opening sentence is a long semicolon-chained run-on that largely restates the discriminated-union op names already present in the schema. Dense and informative rather than padded, but the structure costs readability.

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, 14-variant tool with no output schema, the description covers source/output semantics, ordering, scoping, drum exclusions, and sibling routing. The return-value story is only partially covered (it says what file is produced but not what the response reports), and 'detail' is left to the schema.

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 earns above that by explaining what 'track' scopes (one track vs all), how 'source' type determines the output artifact, and by giving a worked example that shows how ops compose in order. The per-op fields themselves are left entirely to the schema.

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 ('Transforms notes with an ordered list of operations') and then enumerates the operation families — transpose, quantize, humanize, velocity, filter, fold, invert/reverse, arpeggiate, groove — plus the structural ops. An agent can immediately tell this is the note-level mutation tool, distinct from project_edit and midi_read.

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?

Explicit when-to-use ('Use it for any change to existing notes'), explicit when-not ('Not for reading (use midi_read)'), and explicit routing for the overlapping cases ('Track, tempo and program changes on a project belong to project_edit (addTrack, setTempoSegments, setProgram)'). It also tells the agent how to scope with 'track'.

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