Skip to main content
Glama

Generate Music

lab_generate_music

Generate a MUSIC track for a project — the first step of the rhythm chain, and the only one that costs credits. Default engine: ElevenLabs Music v2.5 (produced, contemporary instrumental beds, 3-300 s, priced per second). Stable Audio stays selectable with tool 'stable_audio' (flat per run, up to 190 s, noticeably dated sound). In an EU project (datenmodus 'eu') the default without tool is 'lyria_music' (Lyria 3.5, Google direct, flat per track); ElevenLabs is refused there. Lyria picks its own length, so the track is cut to duration_seconds with a fade-out; a shorter track is delivered as it came and the row carries its real length. ElevenLabs refuses prompts that name artists, bands or song lyrics; the failed row then carries its suggested rewording in metadata.error. ASYNCHRONOUS: the call returns immediately with a row whose audio_url is null and metadata.status is 'pending'. Nothing is playable and nothing can be bound yet. Poll lab_list_audio (audio_type 'music') until that row's status is 'completed' and audio_url is set — usually under a minute, and the backend gives up after five (status turns 'failed', metadata.error carries the reason, and the credits are refunded). PUT THE TEMPO IN THE PROMPT if you intend to cut on the beat. This is measured, not assumed: a soft swing track measured at confidence 0.164 (unusable), an ordered hard pulse ('techno, 128 bpm, four-on-the-floor') at 0.621. The tempo detector is autocorrelation over an onset envelope — it finds a hard pulse and shrugs at drone, ambient and rubato. Then: lab_bind_audio, lab_beatgrid, lab_apply_rhythm.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "project_id": "<project_id>",
      "prompt": "<prompt>"
    },
    "name": "lab_generate_music"
  }
}

Input Schema

NameRequiredDescriptionDefault
toolNoMusic engine. Default 'elevenlabs_music' (ElevenLabs Music v2.5, per second, 3-300 s); in an EU project the default is 'lyria_music' (Lyria 3.5, Google direct, flat per track, cut to duration_seconds). 'stable_audio' is the older flat-priced engine (1-190 s)
promptYesWhat the music should be. Name genre, instrumentation, mood AND the tempo in bpm if the cut is supposed to sit on the beat — e.g. 'driving techno, four-on-the-floor kick, 128 bpm, no vocals'. A prompt without a stated pulse is the usual reason lab_beatgrid comes back unreliable
get_costNo`true` preflights the credit price and your balance WITHOUT generating anything and without spending quota.
scene_refNoOptional scene label, stored on the row. Useful to tell several tracks of one project apart
project_idYesProject id (from lab_list_projects) — positive integer as string
duration_secondsNoTrack length in seconds (default 30). ElevenLabs takes 3-300 s (shorter is raised to 3), Stable Audio up to 190 s. Make it at least as long as the sequence you want to cut — lab_apply_rhythm computes durations for the clips that exist and neither adds nor deletes any, so a short track under a long timeline stays a short track

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / tool / description
      Previous value: -"Music engine. Default 'elevenlabs_music' (ElevenLabs Music v2.5, per second, 3-300 s). 'stable_audio' is the older flat-priced engine (1-190 s)"New value: +"Music engine. Default 'elevenlabs_music' (ElevenLabs Music v2.5, per second, 3-300 s); in an EU project the default is 'lyria_music' (Lyria 3.5, Google direct, flat per track, cut to duration_seconds). 'stable_audio' is the older flat-priced engine (1-190 s)"
    • changedInput schema / properties / tool / enum
      Previous value: -[
      -  "elevenlabs_music",
      -  "stable_audio"
      -]New value: +[
      +  "elevenlabs_music",
      +  "lyria_music",
      +  "stable_audio"
      +]
  2. Changed3 schema fields changed
    • changedInput schema / properties / duration_seconds / description
      Previous value: -"Track length in seconds (default 30, Stable Audio's ceiling is 190). Make it at least as long as the sequence you want to cut — lab_apply_rhythm computes durations for the clips that exist and neither adds nor deletes any, so a short track under a long timeline stays a short track"New value: +"Track length in seconds (default 30). ElevenLabs takes 3-300 s (shorter is raised to 3), Stable Audio up to 190 s. Make it at least as long as the sequence you want to cut — lab_apply_rhythm computes durations for the clips that exist and neither adds nor deletes any, so a short track under a long timeline stays a short track"
    • changedInput schema / properties / duration_seconds / maximum
      Previous value: -190New value: +300
    • addedInput schema / properties / tool
      Added value: +{
      +  "description": "Music engine. Default 'elevenlabs_music' (ElevenLabs Music v2.5, per second, 3-300 s). 'stable_audio' is the older flat-priced engine (1-190 s)",
      +  "enum": [
      +    "elevenlabs_music",
      +    "stable_audio"
      +  ],
      +  "type": "string"
      +}
  3. Changed1 schema field changed
    • addedInput schema / additionalProperties
      Added value: +false
  4. First observed

TDQS

A4.8/5.0
Behavior5/5

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

The annotations only declare readOnlyHint=false and destructiveHint=false, so the description carries the real burden and does: it discloses that the call spends credits, is asynchronous and returns a pending row with null audio_url, that the backend gives up after five minutes with a refund, and that ElevenLabs refuses artist/band/lyric prompts with a rewording in metadata.error. These are non-obvious failure and cost semantics an agent could not infer from structured fields.

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?

Front-loaded with purpose and cost, then engine selection, async semantics, and the prompt/tempo warning in a logical order. It is long, and the detector internals ('autocorrelation over an onset envelope') plus the specific confidence figures are more detail than an agent strictly needs, though they do back the actionable instruction.

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?

For a credit-spending, asynchronous generator with no output schema, the description covers everything material: return row shape (audio_url null, metadata.status 'pending'), polling target and typical latency, terminal failure state with refund, engine-specific constraints, and the downstream binding chain. Nothing an agent needs to call it correctly and handle the result is missing.

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

Parameters4/5

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

Schema coverage is 100%, so the schema already documents all six parameters and the baseline is 3. The description still adds value the schema does not: per-region defaults for `tool`, the instruction to state tempo in `prompt` with measured detector evidence, and the consequence that a short `duration_seconds` under a long timeline stays short because lab_apply_rhythm neither adds nor deletes clips.

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?

Opens with a specific verb and resource ('Generate a MUSIC track for a project') and immediately positions it in the workflow as 'the first step of the rhythm chain, and the only one that costs credits'. It distinguishes itself from lab_generate and the downstream siblings (lab_bind_audio, lab_beatgrid, lab_apply_rhythm) without the agent needing to open another schema.

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

Usage Guidelines5/5

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

Names concrete alternatives and the conditions that select them: stable_audio for the older flat-priced engine, lyria_music forced in EU projects where ElevenLabs is refused, and get_cost=true as a no-spend preflight. It also spells out the required follow-up sequence (poll lab_list_audio with audio_type 'music', then bind, beatgrid, apply_rhythm), which is the exact when-and-what-next guidance an agent needs.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources