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"],
    },

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