Skip to main content
Glama
libsonare-mcp

libsonare-mcp

Official
by libraz

Read a MIDI file or project

midi_read
Read-only

Inspect Standard MIDI files or inline tracks to list tracks, channels, instruments, notes, tempo, time signatures, and piano-roll data before editing or verifying generated output.

Instructions

Lists what is inside a Standard MIDI File, a project file's MIDI tracks or inline tracks: tracks with channel, General MIDI instrument, note count and pitch range, the tempo (BPM) map, time signatures, length in quarter notes (PPQ), and a paged piano-roll note table. Use it to inspect a .mid file before editing or placing it on a project track, or to check what another tool wrote. Not for audio files (use audio_analyze or audio_transcribe) and not for changing the music (use midi_edit). Example: {"source": "song.mid", "detail": "full", "range": {"start_ppq": 0, "end_ppq": 16}}.

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>"
    },
    "name": "midi_read"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum number of note rows to return (1-1000, default 200).
rangeNoOnly list notes starting inside this window (quarter notes). Omit for all.
trackNoTrack to use: its id (integer from 1) or its unique name. Omit for every track.
detailNo'concise' returns the summary and the most useful fields; 'full' returns all.concise
offsetNoIndex of the first note row to return.
sourceYesA .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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

The annotations already declare readOnlyHint=true and openWorldHint=false, so the safety profile is known. The description adds substantial behavioral context beyond that by describing exactly what the read returns: per-track channel, GM instrument, note count and pitch range, tempo map, time signatures, PPQ length, and a paged piano-roll note table. It does not discuss error behavior or access requirements, but with annotations covering safety this is a strong disclosure.

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 definition is front-loaded with the core purpose and output list, then immediately gives usage boundaries and a compact example. Despite being dense, every sentence carries actionable information and there is no redundant restatement of the tool name or title.

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?

There is no output schema, so the description carries the burden of explaining return values, and it does so thoroughly by enumerating the summary fields and the paged note table. With six parameters fully covered by the schema and clear usage boundaries, an agent has everything needed to call this tool correctly.

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 description coverage is 100%, so every parameter is already documented in the schema, which sets the baseline at 3. The description's example shows a meaningful combination of source, detail, and range, but it does not add syntax or semantics beyond what the schema already provides for limit, offset, track, detail, and source.

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?

The description opens with a specific verb and resource: it lists what is inside a Standard MIDI File, a project file's MIDI tracks, or inline tracks. It enumerates the concrete outputs (tracks, channel, GM instrument, note count, pitch range, tempo map, time signatures, PPQ length, piano-roll note table), so an agent can distinguish this inspection tool from midi_edit, midi_write, or audio tools 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?

It states explicit when-to-use cases: inspect a .mid before editing or placing it on a project track, or check what another tool wrote. It also gives clear exclusions and routes the agent to the right alternatives, naming audio_analyze/audio_transcribe for audio files and midi_edit for changing the music.

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