Skip to main content
Glama

mfcc

Extract Mel-frequency cepstral coefficients (MFCC) from audio files to analyze spectral content for music analysis applications.

Instructions

Computes the MFCC of the given audio time series using librosa.
The MFCC is a representation of the audio signal in terms of its
spectral content, which is useful for music analysis.
The MFCC is computed using the following parameters:
- path_audio_time_series_y: The path to the audio time series (CSV file).
    It's sometimes better to take harmonics only

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
path_audio_time_series_yYes

Implementation Reference

  • The handler function for the 'mfcc' tool. It loads the audio time series from a CSV file, computes the MFCC features using librosa.feature.mfcc, saves the result to a new CSV file in temp dir, and returns the path to that file. The @mcp.tool() decorator registers it as an MCP tool.
    @mcp.tool()
    def mfcc(
        path_audio_time_series_y: str,
    ) -> str:
        """
        Computes the MFCC of the given audio time series using librosa.
        The MFCC is a representation of the audio signal in terms of its
        spectral content, which is useful for music analysis.
        The MFCC is computed using the following parameters:
        - path_audio_time_series_y: The path to the audio time series (CSV file).
            It's sometimes better to take harmonics only
        """
        y = np.loadtxt(path_audio_time_series_y, delimiter=";")
        mfcc = librosa.feature.mfcc(y=y)
        # Save the mfcc to a CSV file
        name = path_audio_time_series_y.split("/")[-1].split(".")[0] + "_mfcc"
        mfcc_path = os.path.join(tempfile.gettempdir(), name + ".csv")
        np.savetxt(mfcc_path, mfcc, delimiter=";")
        # Return the path to the CSV file
        return mfcc_path
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions the tool computes MFCC using librosa and notes 'It's sometimes better to take harmonics only', which adds some context about input considerations. However, it lacks critical behavioral details such as what the output looks like (e.g., MFCC coefficients as an array), performance characteristics, or any error handling, leaving significant gaps for a tool with computational implications.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is moderately concise with three sentences, but it could be more front-loaded. The first sentence clearly states the action, but the second sentence about MFCC representation is somewhat redundant with the first. The third sentence adds parameter details, which is useful but disrupts flow. Overall, it's not wasteful but lacks optimal structure for quick comprehension.

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 no annotations, no output schema, and a single parameter with low schema coverage, the description is incomplete. It explains the parameter well but fails to describe the output (e.g., what MFCC data is returned), which is critical for a computational tool. Without this, an agent cannot fully understand how to use the results, making the context insufficient for effective tool invocation.

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 input schema has 1 parameter with 0% description coverage, so the description must compensate. It explains 'path_audio_time_series_y' as 'The path to the audio time series (CSV file)' and adds the heuristic 'It's sometimes better to take harmonics only', which provides meaningful semantic context beyond the schema's basic type. This adequately clarifies the parameter's purpose and usage nuance.

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

Purpose3/5

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

The description states the tool 'Computes the MFCC of the given audio time series using librosa' and mentions it's 'useful for music analysis', which provides a basic purpose. However, it doesn't clearly distinguish this from sibling tools like 'chroma_cqt' or 'tempo' which also analyze audio features, making the differentiation vague. The purpose is understandable but lacks specificity about what makes MFCC unique compared to alternatives.

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 sibling tools such as 'beat_track' or 'chroma_cqt'. It mentions MFCC is 'useful for music analysis', but this is too general and doesn't help an agent decide between similar audio processing tools. There are no explicit when/when-not instructions or alternatives named, leaving usage unclear.

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