Skip to main content
Glama
elevenlabs

ElevenLabs MCP Server

Official
by elevenlabs

compose_music

Read-only

Convert a text prompt to music and save the audio file to a directory. Customize with composition plans, model choice, and instrumental-only generation.

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptNo
output_directoryNo
composition_planNo
music_length_msNo
model_idNomusic_v2
force_instrumentalNo
store_for_inpaintingNo
seedNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations declare readOnlyHint=true, but description reveals side effects: saves files, stores song server-side for inpainting, and incurs costs. This contradiction reduces transparency score to 1.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well-organized with sections and front-loaded purpose. Slightly redundant sentences about output directory, but overall efficient for the complexity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 8 parameters, two models, inpainting workflow, and output schema present, the description covers all necessary context: defaults, model differences, parameter constraints, and cost warning. No gaps for agent decision-making.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, but the description explains all 8 parameters in detail, including composition plan structure per model, default paths, and constraints like music_length_ms bounds. Fully compensates for schema gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states 'Convert a prompt to music and save the output audio file to a given directory' with specific verb and resource. Distinguishes from sibling audio tools by focusing on music composition and two models.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides usage context: must provide prompt or composition_plan, defaults, and cost warning to use only when explicitly requested. Could be more explicit about when not to use but reasonably covers alternative models and inpainting requirements.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/elevenlabs/elevenlabs-mcp'

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