Skip to main content
Glama

beat_track

Analyze audio rhythmic content by computing beat tracks for music analysis. Uses librosa to detect tempo and beat positions from audio time series.

Instructions

Computes the beat track of the given audio time series using librosa.
The beat track is a representation of the audio signal in terms of its
rhythmic content, which is useful for music analysis.
The beat track is computed using the following parameters:
- hop_length: The number of samples between frames.
- start_bpm: The initial estimate of the tempo (in BPM).
- tightness: The tightness of the beat tracking (default is 100).
- units: The units of the beat track (default is "frames"). It can be frames, samples, time.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
path_audio_time_series_yYes
hop_lengthNo
start_bpmNo
tightnessNo
unitsNoframes

Implementation Reference

  • The beat_track tool handler function. Decorated with @mcp.tool() for registration. Loads audio time series, computes tempo and beat frames using librosa.beat.beat_track, and returns a dictionary with tempo (BPM) and beats.
    @mcp.tool()
    def beat_track(
        path_audio_time_series_y: str,
        hop_length: int = 512,
        start_bpm: float = 120,
        tightness: int = 100,
        units: str = "frames",
    ) -> str:
        """
        Computes the beat track of the given audio time series using librosa.
        The beat track is a representation of the audio signal in terms of its
        rhythmic content, which is useful for music analysis.
        The beat track is computed using the following parameters:
        - hop_length: The number of samples between frames.
        - start_bpm: The initial estimate of the tempo (in BPM).
        - tightness: The tightness of the beat tracking (default is 100).
        - units: The units of the beat track (default is "frames"). It can be frames, samples, time.
        """
        y = np.loadtxt(path_audio_time_series_y, delimiter=";")
        tempo, beats = librosa.beat.beat_track(
            y=y,
            hop_length=hop_length,
            start_bpm=start_bpm,
            tightness=tightness,
            units=units,
        )
        return {
            "tempo": tempo,
            "beats": beats,
        }
  • Tool schema definition in the analyze_audio prompt, listing parameters and return type.
    "- beat_track(path_audio_time_series_y: str, hop_length: int = 512, start_bpm: float = 120, "
    "tightness: int = 100, units: str = 'frames') -> dict\n"
  • Core librosa.beat.beat_track call that performs the beat tracking computation.
    tempo, beats = librosa.beat.beat_track(
        y=y,
        hop_length=hop_length,
        start_bpm=start_bpm,
        tightness=tightness,
        units=units,
    )
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It explains what the tool does and lists parameters, but doesn't describe output format, error conditions, performance characteristics, or any side effects. For a computational tool with 5 parameters, this leaves significant behavioral gaps.

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 well-structured and appropriately sized. It starts with the core purpose, adds context about usefulness, then details parameters in a clear bulleted format. Each sentence earns its place, though the parameter explanations could be slightly more concise.

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

Completeness3/5

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

Given 5 parameters with 0% schema coverage and no output schema, the description does a decent job explaining the tool's purpose and parameters. However, it lacks crucial information about return values, error handling, and practical usage examples that would be needed for complete understanding of this computational tool.

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?

The description adds substantial value beyond the schema, which has 0% description coverage. It explains what 'hop_length', 'start_bpm', 'tightness', and 'units' mean conceptually (e.g., 'tightness of the beat tracking', 'units of the beat track'), providing semantic context that the bare schema titles lack. However, it doesn't fully cover all parameters or provide detailed usage examples.

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 'computes the beat track of the given audio time series using librosa' and explains it's 'useful for music analysis', providing a specific verb (computes) and resource (beat track). However, it doesn't explicitly differentiate from sibling tools like 'tempo' which might be related to rhythmic analysis, leaving room for improvement in sibling distinction.

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 no guidance on when to use this tool versus alternatives like 'tempo' or 'mfcc' for music analysis. It mentions the tool's purpose but offers no context about when it's appropriate or what scenarios it's best suited for, leaving the agent without usage direction.

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