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
| Name | Required | Description | Default |
|---|---|---|---|
| audio_url | Yes | URL of the audio file to process | |
| extraction_type | Yes | Type of extraction to perform | |
| webhook_url | No | URL for callback upon completion |
Implementation Reference
- src/index.ts:946-965 (handler)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"], }, },
- src/index.ts:256-274 (schema)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"], },