Skip to main content
Glama
pixxelboy
by pixxelboy

separate_stems

Separate audio files into individual stems like vocals, drums, bass, and instruments using IRCAM Amplify's audio processing. Accepts public URLs for MP3, WAV, FLAC, OGG, or M4A files.

Instructions

Separate an audio file into individual stems: vocals, drums, bass, and other instruments. Accepts a public URL to an audio file (MP3, WAV, FLAC, OGG, M4A). For longer files, returns a job_id for async processing - use check_job_status to monitor progress.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
audio_urlYesPublic URL to the audio file to separate

Implementation Reference

  • The handler function that validates the input audio URL, calls the IRCAM Stem Separator API, transforms the response, and returns either a JobReference for async processing or StemSeparationResult with stem URLs.
    export async function handleSeparateStems( args: Record<string, unknown> ): Promise<SeparateStemsOutput> { const audioUrl = args.audio_url as string; // Validate input const validation = validateAudioUrl(audioUrl); if (!validation.valid) { throw validation.error; } // Call IRCAM Stem Separator API const url = buildApiUrl(IRCAM_API_CONFIG.ENDPOINTS.STEM_SEPARATOR); const response = await httpPost<IrcamStemSeparatorResponse>(url, { url: audioUrl, }); if (!response.ok || !response.data) { throw response.error || formatError('UNKNOWN_ERROR', 'Failed to separate stems'); } // Transform response const transformed = transformStemSeparatorResponse(response.data); // Return either job reference or direct result if (transformed.job_id) { return { job_id: transformed.job_id } as JobReference; } return { vocals_url: transformed.vocals_url!, drums_url: transformed.drums_url!, bass_url: transformed.bass_url!, other_url: transformed.other_url!, } as StemSeparationResult; }
  • Tool definition including name, description, and input schema for the separate_stems tool.
    export const separateStemsTool: Tool = { name: 'separate_stems', description: 'Separate an audio file into individual stems: vocals, drums, bass, and other instruments. ' + 'Accepts a public URL to an audio file (MP3, WAV, FLAC, OGG, M4A). ' + 'For longer files, returns a job_id for async processing - use check_job_status to monitor progress.', inputSchema: { type: 'object', properties: { audio_url: { type: 'string', description: 'Public URL to the audio file to separate', }, }, required: ['audio_url'], }, };
  • Type definitions for StemSeparationResult and SeparateStemsOutput (union with JobReference).
    // Tool-Specific Types: separate_stems // ============================================================================ /** * Résultat de la séparation de stems */ export interface StemSeparationResult { /** URL du stem vocals */ vocals_url: string; /** URL du stem drums */ drums_url: string; /** URL du stem bass */ bass_url: string; /** URL du stem other instruments */ other_url: string; } /** * Output peut être soit un job_id (async) soit le résultat direct */ export type SeparateStemsOutput = JobReference | StemSeparationResult;
  • src/index.ts:37-43 (registration)
    Registration of the separateStemsTool in the TOOLS array for listTools request.
    const TOOLS = [ analyzeMusicTool, separateStemsTool, detectAiMusicTool, analyzeLoudnessTool, checkJobStatusTool, ];
  • src/index.ts:48-54 (registration)
    Mapping of 'separate_stems' tool name to its handler function in TOOL_HANDLERS for execution.
    const TOOL_HANDLERS: Record<string, (args: Record<string, unknown>) => Promise<unknown>> = { analyze_music: handleAnalyzeMusic, separate_stems: handleSeparateStems, detect_ai_music: handleDetectAiMusic, analyze_loudness: handleAnalyzeLoudness, check_job_status: handleCheckJobStatus, };

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/pixxelboy/amplify-mcp'

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