Skip to main content
Glama

tempo

Analyze audio files to detect tempo in beats per minute (BPM) using time series data, with configurable parameters for precise measurement.

Instructions

Estimates the tempo (in BPM) of the given audio time series using librosa. Offset and duration are optional, in seconds.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
path_audio_time_series_yYes
hop_lengthNo
start_bpmNo
std_bpmNo
ac_sizeNo
max_tempoNo

Implementation Reference

  • The main handler function for the 'tempo' tool. It loads the audio time series from a CSV file and estimates the tempo in BPM using librosa.feature.tempo.
    @mcp.tool()
    def tempo(
        path_audio_time_series_y: str,
        hop_length: int = 512,
        start_bpm: float = 120,
        std_bpm: float = 1.0,
        ac_size: float = 8.0,
        max_tempo: float = 320.0,
    ) -> float:
        """
        Estimates the tempo (in BPM) of the given audio time series using librosa.
        Offset and duration are optional, in seconds.
        """
        y = np.loadtxt(path_audio_time_series_y, delimiter=";")
        tempo = librosa.feature.tempo(
            y=y,
            hop_length=hop_length,
            start_bpm=start_bpm,
            std_bpm=std_bpm,
            ac_size=ac_size,
            max_tempo=max_tempo,
        )
        return tempo
  • The input schema for the 'tempo' tool as listed in the MCP prompt, defining parameters and return type.
    "- tempo(path_audio_time_series_y: str, hop_length: int = 512, start_bpm: float = 120, "
    "std_bpm: float = 1.0, ac_size: float = 8.0, max_tempo: float = 320.0) -> float\n"
  • The @mcp.tool() decorator registers the tempo function as an MCP tool.
    @mcp.tool()
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions 'estimates' and 'using librosa,' implying a read-only analysis, but lacks details on behavioral traits such as performance characteristics, error handling, or output format. It doesn't disclose whether this is computationally intensive, if it requires specific audio formats, or what the result looks like beyond BPM.

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 description is concise with two sentences, front-loaded with the core purpose. It avoids redundancy, but the second sentence about 'offset and duration' is misleading as it doesn't align with the actual parameters, slightly reducing efficiency.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 6 parameters with 0% schema coverage, no annotations, and no output schema, the description is incomplete. It doesn't explain the input parameters, expected output (beyond BPM), or behavioral context, making it inadequate for an AI agent to use the tool effectively without additional documentation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It only mentions 'offset and duration are optional, in seconds,' which doesn't map to any of the 6 parameters in the schema (e.g., 'path_audio_time_series_y,' 'hop_length'). This adds minimal meaning beyond the schema, failing to explain what parameters like 'std_bpm' or 'ac_size' do, leaving most semantics undocumented.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Estimates the tempo (in BPM) of the given audio time series using librosa.' It specifies the verb ('estimates'), resource ('tempo of audio time series'), and method ('using librosa'), though it doesn't explicitly differentiate from siblings like 'beat_track' which might also relate to tempo analysis.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides minimal usage guidance: 'Offset and duration are optional, in seconds.' This hints at optional parameters but doesn't explain when to use this tool versus alternatives like 'beat_track' or other audio processing siblings, nor does it mention prerequisites or typical scenarios for tempo estimation.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hugohow/mcp-music-analysis'

If you have feedback or need assistance with the MCP directory API, please join our Discord server