Skip to main content
Glama
libsonare-mcp

libsonare-mcp

Official
by libraz

Analyze tempo, key and chords

audio_analyze
Read-only

Analyze audio files to detect tempo, key, chord progression, structure, beats, and more, with confidence warnings for uncertain estimates.

Instructions

Analyses music: tempo (BPM) with alternatives, beats, onsets, meter (time signature), key with ranked candidates, a chord timeline with bar and beat, sections, melody, tuning, timbre, dynamics, rhythm and percussive hits, with roman numerals and harmonic functions on request. Use it to answer 'what is the BPM / key / chord progression / structure of this song'. Every estimate carries a confidence and the warnings say where it is shaky, for example a wrong meter or a half-time tempo; bar and beat are always attached even when the meter is doubtful. Tempo and key are the derivation project_create and midi_compose use; the first key candidate is the bass-weighted full-analysis key and the rest are ranked by chroma alone, so their confidences are not comparable, and hits are rule-based detections. Do not use it for loudness (audio_loudness), a single pitch track (audio_pitch) or raw spectral features (audio_features); symbolic files go to midi_read and theory_analyze. Example: {"path": "song.wav", "aspects": ["tempo", "key", "chords"], "chords_seventh": true}.

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

Input Schema

NameRequiredDescriptionDefault
listNoWhich list 'offset' pages through: beats, onsets, chords, tempoCurve or hits. Omit it when only one of these lists is requested; the other lists start at their first item and obey 'limit'.
pathYesAudio file to analyze (wav, mp3, flac, ogg, opus, aiff, m4a).
limitNoMaximum items per paged list (beats, onsets, chords, tempoCurve, hits), 1-1000.
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
offsetNoFirst item to return of the list chosen by 'list'; past the end returns an empty list and its total.
aspectsNoWhat to report: tempo, beats, onsets, meter, key, chords, sections, melody, tuning, timbre, dynamics, rhythm, hits (percussive events with strength). Defaults to tempo, meter, key, chords, sections.
genre_hintNoGenre prior for the key estimate: auto, edm, electronic, dance, pop, classical or jazz. See key_profile for how it changes the ranking.
resolutionNoTime-series density: none returns summary statistics only; coarse 0.5, medium 1 and fine 4 points per second return a list of points with time_sec and the measured value. With the melody aspect it returns melody_contour.none
key_profileNoKey-profile table for the key estimate: krumhanslSchmuckler, temperley, shaath, faraldoEdmt, faraldoEdma, faraldoEdmm or bellmanBudge. Giving it or genre_hint ranks the keys by chroma alone; omit both for the full analysis key.
chords_seventhNoName seventh/extended chords (Cmaj7, G9); false reduces chords to triads.
chords_functionsNoAdd each chord's roman numeral and harmonic function (tonic, subdominant, dominant, ...) relative to the reported key.
n_key_candidatesNoHow many ranked key candidates to return (1-24).
compute_tempo_curveNoAlso return the local tempo at every beat, for material whose tempo moves.
chords_chroma_methodNoChroma the chord detector reads: stft, nnls or cqt. Giving this or chords_min_duration_sec runs the standalone chord detector instead of the full analysis (its default is cqt); omit both for the analysis chords.
chords_min_duration_secNoShortest chord kept, in seconds (standalone detector; its default is 0.3).
detect_chord_inversionsNoDetect inversions and write slash chords (C/E).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, but the description adds substantial behavioral context: every estimate carries a confidence, warnings indicate shaky meter or half-time tempo, bar and beat are always attached, and hits are rule-based. It also discloses downstream derivation by project_create and midi_compose and explains that key-candidate confidences are not comparable across ranking methods.

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?

The purpose and main exclusions are front-loaded, and nearly every sentence carries useful information. However, the description is a dense single paragraph that packs numerous caveats, derivation notes and examples together; it could be more scannable with light structuring, and some clauses are long.

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?

For a complex 17-parameter analysis tool with no output schema, the description is complete enough: it enumerates the returned aspects, explains confidence and warning behavior, covers key-candidate ranking caveats, notes chord/hit detection traits, and provides a usage example. An agent has the information needed to select and call it correctly.

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 description coverage is 100%, so all 17 parameters are already documented. The description still adds genuine meaning beyond the schema by explaining that the first key candidate is the bass-weighted full-analysis key while the rest are chroma-ranked, making their confidences non-comparable, and by illustrating the aspects and chords_seventh usage in the example. This is more than baseline schema repetition, though it does not explain every parameter.

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 ('Analyses music') and then enumerates the exact outputs: tempo, beats, onsets, meter, key, chords, sections, melody, tuning, timbre, dynamics, rhythm and hits. It is easy to distinguish from sibling tools such as audio_loudness and audio_pitch because those are explicitly named as out-of-scope alternatives.

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 gives explicit when-to-use guidance by naming the user questions it answers ('what is the BPM / key / chord progression / structure of this song'). It also gives when-not-to-use guidance with concrete alternatives for loudness (audio_loudness), pitch tracking (audio_pitch), spectral features (audio_features), symbolic files (midi_read) and theory (theory_analyze).

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