Skip to main content
Glama
libsonare-mcp

libsonare-mcp

Official
by libraz

Extract audio features (MFCC, chroma, spectral)

audio_features
Read-only

Compute music-information-retrieval features like MFCC, chroma, spectral centroid and tempogram at the file's own sample rate, returning statistics, time series, or exported matrices for timbre comparisons and custom scripts.

Instructions

Computes music-information-retrieval features at the file's own sample rate: spectral centroid, bandwidth, rolloff, flatness and contrast, zero-crossing rate, RMS, MFCC and its deltas, four chroma variants, tonnetz, onset strength (also per band), spectral flux, polynomial features, PLP, several tempogram forms and an octave-band spectrum over time. Returns statistics (mean, std, p10, p50, p90), a time series at a chosen resolution, or exports the full matrices as npy or csv files in the output directory for further processing. Use it for brightness/timbre comparisons and as input to your own scripts. Do not use it for loudness (audio_loudness), tempo or key (audio_analyze) or to look at a spectrogram (audio_visualize). Example: {"path": "take.wav", "features": ["mfcc", "chroma"], "aggregate": "export", "export_format": "csv"}.

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_features"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesAudio file to compute features for.
rangeNoAnalyze only this window ({start_sec, end_sec}, in seconds); times in the result stay on the file's own timeline. Omit for the whole file.
detailNo'concise' returns the summary and the most useful fields; 'full' returns all.concise
featuresNoFeatures: centroid, bandwidth, rolloff, flatness, contrast, zcr, rms, mfcc, mfccDelta, chroma, chromaCqt, chromaCens, nnlsChroma, bassChroma, tonnetz, onsetStrength, onsetStrengthMulti, spectralFlux, poly, plp, tempogram, fourierTempogram, cyclicTempogram, tempogramRatio, spectrum (octave-band level in dB over time, floored 80 dB below its loudest cell like the mel view). Defaults to centroid, bandwidth, rolloff, flatness, zcr, rms.
aggregateNostats: mean/std/p10/p50/p90 per feature (and per row for mfcc, chroma, ...); series: values over time at 'resolution'; export: write the full matrices to files.stats
resolutionNoSeries density for aggregate series: coarse 0.5, medium 1, fine 4 points/s.medium
export_formatNoFile type for aggregate export: npy (float32 array, rows x frames) or csv.npy
tempogram_modeNoTempogram method for tempogram: autocorrelation or cosine. Omit for the library default (autocorrelation).

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 only declare readOnlyHint=true and openWorldHint=false; the description goes further by disclosing that computation happens at the file's own sample rate, that the tool has three distinct output modes, and that 'export' writes npy/csv matrices into the output directory. That last point is a filesystem side effect worth flagging against readOnlyHint, though it is disclosed rather than contradicted. It stops short of describing error behavior or file-size implications of exporting large matrices.

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?

Well front-loaded: what it computes, then the three return modes, then when/when-not, then an example. The long feature enumeration largely restates the schema enum and is the one place it spends words without adding information, but the ordering is deliberate and no sentence is filler.

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?

With 8 parameters and no output schema, the description carries the burden of explaining return values and does so: statistics (mean, std, p10, p50, p90), a time series at a chosen resolution, or exported matrices. Combined with the exclusions and example, an agent has everything needed to call it 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% and the schema already explains aggregate modes, resolution densities and export formats in detail, so the description duplicates rather than extends that knowledge. It does add one useful gloss the schema lacks (spectrum is 'octave-band level in dB over time' semantics are only in the schema, not the description) and an end-to-end example showing path/features/aggregate/export_format together. Baseline 3 is appropriate given the schema does the heavy lifting.

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 ('computes music-information-retrieval features') and enumerates exactly which features, from spectral centroid through tempograms. It also names the sibling tools it is not, so an agent can distinguish it from audio_analyze, audio_loudness and audio_visualize 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 both a positive trigger ('brightness/timbre comparisons', 'input to your own scripts') and explicit exclusions mapped to alternatives: loudness -> audio_loudness, tempo/key -> audio_analyze, spectrogram -> audio_visualize. A concrete example call anchors the guidance.

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