Skip to main content
Glama
libsonare-mcp

libsonare-mcp

Official
by libraz

Track pitch (f0) and notes

audio_pitch
Read-only

Tracks monophonic pitch with YIN or pYIN, segments notes, and reports cents deviation from equal temperament, a key's scale, or a MIDI melody for intonation and tuning checks.

Instructions

Tracks the fundamental frequency of a monophonic voice or instrument with pYIN or YIN, segments it into notes, estimates the tuning offset, and reports each note's deviation in cents from equal temperament, from a key's scale or from the notes of a MIDI file; note_pitch_detail splits each note into center, drift and vibrato. Use it for intonation checks, singing accuracy, tuning (A=440?) and extracting a melody line. Do not use it for chords or polyphonic music (audio_analyze, audio_transcribe) or to correct pitch (audio_vocal). pYIN is limited to 15 minutes of audio; pass 'range' for longer files. Example: {"path": "vocal.wav", "reference": {"key": "A minor"}, "resolution": "medium"}.

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

Input Schema

NameRequiredDescriptionDefault
pathYesAudio file with a monophonic voice or instrument.
limitNoMaximum notes to return, 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
methodNopyin: probabilistic, robust, slower (length-limited); yin: fast, noisier.pyin
offsetNoFirst note to return; past the end returns an empty list and its total.
f0_max_hzNoHighest pitch to track, in Hz.
f0_min_hzNoLowest pitch to track, in Hz.
referenceNoReport each note's deviation in cents against a key's scale ({key}) or against the notes of a MIDI file ({midi, track}). Omit to compare with equal temperament only.
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. Series are in Hz.none
note_pitch_detailNoSplit each note's pitch into its center, slow drift and vibrato: adds center_hz, drift_range_cents and vibrato_extent_cents to every note.

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 only declare readOnlyHint and openWorldHint=false; the description adds genuinely non-obvious behavior: pYIN is length-limited to 15 minutes and requires 'range' for longer files, YIN is faster but noisier, and note_pitch_detail adds center/drift/vibrato fields. It does not describe the returned note list shape or pagination behavior beyond the offset hint, which keeps it short of a 5.

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?

Content is front-loaded and every sentence carries information; the example is a useful concrete anchor. The opening sentence is a long clause chain covering four operations, which costs some scannability for an 11-parameter tool.

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 an 11-parameter, no-output-schema tool it covers methods, references, resolution, limits and detail flags well enough to call it correctly. It is slightly thin on what the result actually contains (note list fields, series structure) beyond the two named per-note fields.

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 baseline is 3, but the description goes beyond it by tying parameters together — pYIN's 15-minute cap implies passing 'range' on long files, and note_pitch_detail is explained in terms of what it produces. The inline example demonstrates how path, reference.key and resolution compose.

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 states a concrete verb and resource ('tracks the fundamental frequency... segments it into notes, estimates tuning offset, reports cents deviation'), and enumerates the three reference modes. It is immediately distinguishable from analysis/transcription siblings because it names the monophonic, note-level scope.

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 cases (intonation checks, singing accuracy, tuning A=440, melody extraction) and explicit when-not cases with named alternatives: no chords/polyphony (audio_analyze, audio_transcribe), no correction (audio_vocal). Nothing is left to inference.

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