extract_audio
Extract vocals, instruments, or specific stems from audio files to isolate musical components for remixing, analysis, or creative projects.
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 inputs, sends a POST request to the external '/extraction' API endpoint, and returns a formatted response with task status information.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:256-274 (schema)The input schema definition for the 'extract_audio' tool, specifying parameters, types, descriptions, enum values, and required fields.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:253-275 (registration)The tool registration object in the TOOLS constant array, which is returned by the listTools handler. Includes name, description, and input schema.{ 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:683-684 (registration)The switch case in the CallToolRequestSchema handler that registers and dispatches 'extract_audio' tool calls to the corresponding handler method.case "extract_audio": return await this.handleExtractAudio(args);