Skip to main content
Glama

get_duration

Calculate audio file duration in seconds from time series data to analyze playback length and timing.

Instructions

Returns the total duration (in seconds) of the given audio time series.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
path_audio_time_series_yYes

Implementation Reference

  • The handler function for the 'get_duration' tool. It loads the audio time series from a CSV file using np.loadtxt and computes the duration using librosa.get_duration.
    @mcp.tool()
    def get_duration(path_audio_time_series_y: str) -> float:
        """
        Returns the total duration (in seconds) of the given audio time series.
        """
        y = np.loadtxt(path_audio_time_series_y, delimiter=";")
        return librosa.get_duration(y=y)
  • The @mcp.tool() decorator registers the get_duration function as an MCP tool.
    @mcp.tool()
  • Tool schema definition listed in the MCP prompt, showing input (path_audio_time_series_y: str) and output (float).
    "- get_duration(path_audio_time_series_y: str) -> float\n"
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 states the tool returns a duration in seconds, but doesn't describe error handling (e.g., for invalid file paths), performance characteristics, or what constitutes a valid 'audio time series'. For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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

Conciseness5/5

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

The description is a single, well-structured sentence that efficiently communicates the core functionality. It's front-loaded with the key action ('Returns') and includes essential details (unit of measurement) without unnecessary elaboration. Every word earns its place.

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 the complexity (1 parameter with 0% schema coverage, no annotations, no output schema), the description is incomplete. It doesn't explain the return format beyond 'in seconds' (e.g., numeric value, error cases), parameter requirements, or how it differs from related audio processing tools. For a tool with minimal structured data, more context is needed.

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 for undocumented parameters. It mentions 'the given audio time series' which relates to the single parameter, but doesn't explain what 'path_audio_time_series_y' represents (e.g., file path format, expected data structure). The description adds minimal semantic value beyond what's inferable from the parameter name.

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 with a specific verb ('Returns') and resource ('total duration of the given audio time series'), including the unit of measurement ('in seconds'). It distinguishes itself from siblings by focusing on duration calculation rather than audio processing tasks like beat tracking or feature extraction. However, it doesn't explicitly differentiate from all siblings (e.g., 'tempo' also relates to timing).

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. It doesn't mention prerequisites (e.g., needing an audio time series file), exclusions, or comparisons to sibling tools like 'tempo' (which might provide timing-related information). Usage is implied through the parameter name but not explicitly stated.

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