Skip to main content
Glama

extract_key_bpm

Analyze audio files to detect musical key and tempo (BPM) for music production, DJ sets, or audio analysis workflows.

Instructions

Extract musical key and BPM (tempo) from audio

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
audio_urlYesURL of the audio file to analyze
webhook_urlNoURL for callback upon completion

Implementation Reference

  • The handler function that implements the 'extract_key_bpm' tool logic. It validates the audio_url parameter, makes an asynchronous POST request to the '/extract_key_bpm' endpoint with audio_url and optional webhook_url, and returns a formatted text response containing the task status and instructions for checking progress.
    private async handleExtractKeyBpm(args: any) { if (!args.audio_url) { throw new McpError(ErrorCode.InvalidParams, "audio_url is required"); } const response = await this.axiosInstance.post("/extract_key_bpm", { audio_url: args.audio_url, webhook_url: args.webhook_url, }); return { content: [ { type: "text", text: `Key and BPM extraction started!\n\n${JSON.stringify(response.data, null, 2)}\n\nUse get_conversion_by_id with the task_id to check the status.`, }, ], }; }
  • Input schema for the 'extract_key_bpm' tool, defining the expected parameters: audio_url (required string) and optional webhook_url (string). Used for validation and tool description.
    inputSchema: { type: "object" as const, properties: { audio_url: { type: "string", description: "URL of the audio file to analyze", }, webhook_url: { type: "string", description: "URL for callback upon completion", }, }, required: ["audio_url"], },
  • src/index.ts:543-560 (registration)
    Registration of the 'extract_key_bpm' tool in the TOOLS constant array, which is returned by the ListTools handler. Includes name, description, and input schema.
    { name: "extract_key_bpm", description: "Extract musical key and BPM (tempo) from audio", inputSchema: { type: "object" as const, properties: { audio_url: { type: "string", description: "URL of the audio file to analyze", }, webhook_url: { type: "string", description: "URL for callback upon completion", }, }, required: ["audio_url"], }, },
  • src/index.ts:715-716 (registration)
    Dispatch case in the CallTool request handler switch statement that routes execution to the handleExtractKeyBpm method.
    case "extract_key_bpm": return await this.handleExtractKeyBpm(args);

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/pasie15/mcp-server-musicgpt'

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