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"

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