Skip to main content
Glama

extract_audio

Extract vocals, instruments, or specific stems from audio files for music production and analysis. Process audio by providing a URL and selecting extraction type.

Instructions

Extract vocals, instruments, or specific stems from audio

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
audio_urlYesURL of the audio file to process
extraction_typeYesType of extraction to perform
webhook_urlNoURL for callback upon completion

Implementation Reference

  • The handler function that implements the core logic of the 'extract_audio' tool. It validates the required parameters (audio_url and extraction_type), makes a POST request to the '/extraction' API endpoint with optional webhook_url, and returns a formatted response including the task_id for status checking.
    private async handleExtractAudio(args: any) {
      if (!args.audio_url || !args.extraction_type) {
        throw new McpError(ErrorCode.InvalidParams, "audio_url and extraction_type are required");
      }
    
      const response = await this.axiosInstance.post("/extraction", {
        audio_url: args.audio_url,
        extraction_type: args.extraction_type,
        webhook_url: args.webhook_url,
      });
    
      return {
        content: [
          {
            type: "text",
            text: `Audio 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:683-684 (registration)
    The switch case in the CallToolRequestSchema handler that routes calls to the 'extract_audio' tool to its handler function.
    case "extract_audio":
      return await this.handleExtractAudio(args);
  • src/index.ts:254-275 (registration)
    The tool definition in the TOOLS array used for listing tools, including the name 'extract_audio', description, and input schema for validation.
      name: "extract_audio",
      description: "Extract vocals, instruments, or specific stems from audio",
      inputSchema: {
        type: "object" as const,
        properties: {
          audio_url: {
            type: "string",
            description: "URL of the audio file to process",
          },
          extraction_type: {
            type: "string",
            description: "Type of extraction to perform",
            enum: ["vocals", "instrumental", "drums", "bass", "piano", "other"],
          },
          webhook_url: {
            type: "string",
            description: "URL for callback upon completion",
          },
        },
        required: ["audio_url", "extraction_type"],
      },
    },
  • The input schema defining parameters and validation for the 'extract_audio' tool.
    inputSchema: {
      type: "object" as const,
      properties: {
        audio_url: {
          type: "string",
          description: "URL of the audio file to process",
        },
        extraction_type: {
          type: "string",
          description: "Type of extraction to perform",
          enum: ["vocals", "instrumental", "drums", "bass", "piano", "other"],
        },
        webhook_url: {
          type: "string",
          description: "URL for callback upon completion",
        },
      },
      required: ["audio_url", "extraction_type"],
    },
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. It states what the tool does but doesn't disclose behavioral traits such as processing time, file size limits, supported audio formats, error handling, or that it's an asynchronous operation (implied by the webhook_url parameter but not explained). This leaves significant gaps for an AI agent.

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 front-loads the core purpose without unnecessary words. It directly states the tool's function, making it easy to parse and understand 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 processing and lack of annotations or output schema, the description is incomplete. It doesn't cover behavioral aspects (e.g., async nature, limits), output details (e.g., format of extracted audio), or error conditions. For a tool with 3 parameters and no structured safety hints, more context is needed.

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?

Schema description coverage is 100%, so the schema already documents all parameters (audio_url, extraction_type, webhook_url) with descriptions and an enum for extraction_type. The description adds minimal value beyond the schema by listing extraction types ('vocals, instruments, or specific stems'), but doesn't provide additional semantics like format details or usage examples.

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: 'Extract vocals, instruments, or specific stems from audio'. It specifies the verb ('extract') and resource ('audio'), and lists the types of extractions. However, it doesn't explicitly differentiate from sibling tools like 'cut_audio' or 'denoise_audio', which might also process audio but for different purposes.

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., audio format requirements), when not to use it, or how it compares to siblings like 'audio_to_midi' or 'transcribe_audio'. Usage is implied by the purpose but lacks explicit context.

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