compose_music
Turn a text prompt into a music audio file and save it to a directory. Configure model, length, instrumental mode, or inpainting storage.
Instructions
Convert a prompt to music and save the output audio file to a given directory. Directory is optional, if not provided, the output file will be saved to $HOME/Desktop. Saves output file to directory (default: $HOME/Desktop).
Two models are supported:
- music_v2 (default): latest model. Composition plans use a `chunks` array where each chunk is either a `GenerationChunk` (text, duration_ms, positive_styles, negative_styles, context_adherence, optional conditioning_ref + condition_strength) or an `AudioRefChunk` ({song_id, range: {start_ms, end_ms}}) for inpainting. Inpainting also requires the source song to have been stored — call this tool with store_for_inpainting=True or use upload_music_for_inpainting first to get a song_id.
- music_v1: legacy model. Composition plans use positive_global_styles, negative_global_styles, sections.
Args:
prompt: Prompt to convert to music. Must provide either prompt or composition_plan.
output_directory: Directory to save the output audio file
composition_plan: Composition plan dict. Shape depends on model_id (see above). Must provide either prompt or composition_plan.
music_length_ms: Length of the generated music in milliseconds (3000-600000). Cannot be used if composition_plan is provided.
model_id: Which music model to use. One of "music_v1" or "music_v2". Defaults to "music_v2".
force_instrumental: If True, the model will avoid generating lyrics/vocals.
store_for_inpainting: If True, the generated song is stored server-side and the returned song_id can be used in later inpainting calls (as an AudioRefChunk.song_id, or conditioning_ref).
seed: Optional integer seed for reproducible generation (music_v2 only).
⚠️ COST WARNING: This tool makes an API call to ElevenLabs which may incur costs. Only use when explicitly requested by the user.Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "compose_music"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| seed | No | ||
| prompt | No | ||
| model_id | No | music_v2 | |
| music_length_ms | No | ||
| composition_plan | No | ||
| output_directory | No | ||
| force_instrumental | No | ||
| store_for_inpainting | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |