Skip to main content
Glama

extract_key_bpm

Analyze audio files to identify musical key and tempo (BPM), providing essential metadata for music production and analysis.

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 main handler function for the 'extract_key_bpm' tool. Validates input, makes an HTTP POST request to the external API endpoint '/extract_key_bpm', and returns the API response containing task information.
    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.`,
          },
        ],
      };
    }
  • src/index.ts:543-560 (registration)
    Tool registration in the TOOLS array, including name, description, and input schema. This array is returned by the ListTools request handler.
    {
      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"],
      },
    },
  • Dispatch case in the main tool execution switch statement that routes calls to the 'extract_key_bpm' handler.
    case "extract_key_bpm":
      return await this.handleExtractKeyBpm(args);
  • Input schema definition for the 'extract_key_bpm' tool, specifying parameters and validation.
    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"],
    },
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 extraction but doesn't specify if this is a synchronous or asynchronous operation (e.g., due to the webhook_url parameter implying callback), what permissions or rate limits apply, or the format of the extracted data. This leaves key behavioral traits unclear.

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, efficient sentence that directly states the tool's purpose without any fluff. It is front-loaded and appropriately sized, making it easy to parse quickly.

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 of audio analysis, lack of annotations, and no output schema, the description is incomplete. It doesn't explain what the extracted key and BPM output looks like (e.g., numeric BPM, key notation), error handling, or dependencies on other tools. This leaves significant gaps for an AI agent to use it effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, with clear descriptions for both parameters (audio_url and webhook_url). The description adds no additional parameter semantics beyond what the schema provides, such as supported audio formats or webhook payload details. This meets the baseline for high schema coverage.

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 ('extract') and resources ('musical key and BPM from audio'), making it immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'transcribe_audio' or 'audio_to_midi', which might also involve audio analysis but for different outputs, leaving room for potential confusion.

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, such as whether it's for real-time analysis, batch processing, or specific audio formats. With many sibling tools available for audio manipulation, the lack of contextual usage hints is a significant gap.

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

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