Skip to main content
Glama
libsonare-mcp

libsonare-mcp

Official
by libraz

Convert or edit audio

audio_edit
Destructive

Converts audio between formats and edits it with ordered operations such as trim, cut, fade, gain, normalize, pitch shift and time stretch, letting you rewrite a file into a new version in one call.

Instructions

Converts an audio file to another format (wav, flac, ogg, opus, mp3, aiff, m4a; bit depth, quality, sample rate) and/or edits it with an ordered list of ops: trim, cut, fadeIn, fadeOut, gain, normalize (peak, rms, lufs), resample, channels (mono, stereo, left, right, swap), reverse, pad, repeat, trimSilence (peak or lufsGated), dcRemove, pitchShift (pitch_semitones or to_key), timeStretch (speed_ratio, tempo_bpm or duration_sec), moveRegion and stretchRegion (one note or phrase), rearrange (rebuild from slices of the audio), editHits (move, level or mute percussive hits) and spectralEdit (change a time x frequency rectangle). Text tags are carried over. Use it for 'convert to mp3', 'cut from 30 s to 60 s', 'fade out the last 3 seconds', '-3 dB' or 'make it 90 BPM'; ops: [] is a pure conversion. Do not use it for EQ, compression or effects (use audio_process), loudness mastering with a true-peak ceiling (use audio_master), joining several files (create a project with project_create layout "sequence" and render it with project_render) or cutting into several files (use audio_split). Example: {"path": "song.wav", "ops": [{"op": "trim", "start_sec": 30, "end_sec": 60}, {"op": "fadeOut", "duration_sec": 3}], "format": "mp3"}.

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": "audio_edit"
  }
}

Input Schema

NameRequiredDescriptionDefault
opsNoOperations applied in order, each an object with an 'op' name plus its fields: trim, cut, fadeIn, fadeOut, gain, normalize, resample, channels, reverse, pad, repeat, trimSilence, dcRemove, pitchShift, timeStretch, moveRegion, stretchRegion, rearrange, editHits, spectralEdit. Times (start_sec, end_sec) refer to the audio as it is when the op runs. An empty list only converts the file to the format, bit depth, quality, sample rate and name given by the write arguments.
pathYesInput audio file (wav, flac, mp3, ogg, aiff, ...).
detailNo'concise' returns the summary and the most useful fields; 'full' returns all.concise
formatNoOutput format: wav, flac, ogg (Vorbis), opus, mp3, aiff, or m4a (AAC, needs ffmpeg). Default: the explicit output's extension, else the input's format, else wav.
outputNoOutput file path. Default: an auto-named new file '<input stem>.<tool>.<ext>' in the output directory.
dry_runNoReport the resolved output plan and paths without processing or writing.
qualityNoLossy encoder setting for ogg/opus/mp3, 0..1 (soundfile compression_level, variable bit rate): 0 = best quality, 1 = smallest file. On 48 kHz stereo music, mp3 0 / 0.3 / 1 is about 192 / 120 / 55 kbit/s (no 320 kbit/s setting), ogg about 330 / 150 / 45 and opus about 510 / 360 / 13. Default 0.3. Excludes bit_depth.
bit_depthNoPCM bit depth for wav/flac/aiff: 16, 24 or 'float32' (32-bit float; not flac). Default: the input's depth, else 24. Excludes quality.
overwriteNoReplace an existing output file. Without it an existing file is an error.
sample_rateNoOutput sample rate in Hz; the audio is resampled when it differs. Default: the input's rate. Opus is always 48000.

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?

Annotations already declare destructive=true, readOnly=false and non-idempotent, so the write/overwrite risk profile is partly covered; the description adds that text tags are carried over and that ops execute as an ordered pipeline. It does not mention the default new-file output naming or the overwrite-required-to-replace-file rule, which only live 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.

Conciseness4/5

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

Front-loaded with the purpose, then exclusions, then an example — a good order with no filler sentences. The op list is dense and partially duplicated by the schema's own enumeration, which makes the first sentence heavy, but each clause carries information.

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 10-parameter, 20-op destructive tool the description covers purpose, sequencing semantics, format list, exclusions and an example. The one real gap is the return payload: with no output schema and a 'detail' parameter, the description never says what comes back (summary plus output path).

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?

With 100% schema coverage the baseline is 3, and the description clears it by surfacing the op discriminator vocabulary up front along with key field names (pitch_semitones vs to_key, speed_ratio/tempo_bpm/duration_sec, peak/rms/lufs) plus a worked example JSON. That saves a schema traversal for the highest-variance parameter, though it does not add semantics absent from 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?

Names a specific verb pair (converting and editing) plus the resource, enumerates output formats and the full op vocabulary, and explicitly separates itself from audio_process, audio_master, audio_split and project_create/project_render. An agent can distinguish it from every relevant sibling without opening a 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 concrete triggers ('convert to mp3', 'cut from 30 s to 60 s', 'make it 90 BPM'), states that ops: [] means pure conversion, and lists four explicit do-not-use cases each mapped to the correct alternative tool. This is the full when/when-not/alternative triad.

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