isolate_audio
Extract clean audio from files by removing background noise and isolating speech. Saves processed audio to your specified directory using ElevenLabs' audio processing API.
Instructions
Isolate audio from a file. Saves output file to directory (default: $HOME/Desktop).
⚠️ COST WARNING: This tool makes an API call to ElevenLabs which may incur costs. Only use when explicitly requested by the user.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input_file_path | Yes | ||
| output_directory | No |
Implementation Reference
- elevenlabs_mcp/server.py:540-554 (handler)The isolate_audio tool handler function. It takes an input audio file path, optionally an output directory, isolates the audio using the ElevenLabs client.audio_isolation.convert API, and returns the output handled according to the configured output mode (files, resources, or both).def isolate_audio( input_file_path: str, output_directory: str | None = None ) -> Union[TextContent, EmbeddedResource]: file_path = handle_input_file(input_file_path) output_path = make_output_path(output_directory, base_path) output_file_name = make_output_file("iso", file_path.name, "mp3") with file_path.open("rb") as f: audio_bytes = f.read() audio_data = client.audio_isolation.convert( audio=audio_bytes, ) audio_bytes = b"".join(audio_data) # Handle different output modes return handle_output_mode(audio_bytes, output_path, output_file_name, output_mode)
- elevenlabs_mcp/server.py:535-540 (registration)MCP tool registration for isolate_audio using the @mcp.tool decorator, including description with usage instructions and cost warning.description=f"""Isolate audio from a file. {get_output_mode_description(output_mode)}. ⚠️ COST WARNING: This tool makes an API call to ElevenLabs which may incur costs. Only use when explicitly requested by the user. """ ) def isolate_audio(