Skip to main content
Glama

Generate Music

lab_generate_music

Generate a MUSIC track for a project (Stable Audio via fal.ai) — the first step of the rhythm chain, and the only one that costs credits. 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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
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, 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

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / additionalProperties
      Added value: +false
  2. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Annotations only declare readOnlyHint=false and destructiveHint=false, so the description carries real behavioral load and delivers: asynchronous return with a pending row and null audio_url, nothing playable or bindable yet, polling target, ~1 minute typical / 5 minute timeout, 'failed' status with metadata.error, credit refund on failure, and that this is the only credit-consuming step. This is far beyond what the annotations provide.

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

Conciseness5/5

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

Front-loaded with purpose, then async contract, then prompt advice, then the next-step chain. The measured-confidence example (0.164 vs 0.621) and the autocorrelation detail are concrete justification for the tempo instruction rather than padding, so each sentence earns its place.

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?

There is no output schema, so the description must describe the return shape — and it does (row with null audio_url, metadata.status 'pending', later 'completed'/'failed' with metadata.error). Combined with cost, timeout, polling and downstream chaining, an agent has everything needed to call and follow up correctly.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents all five parameters including the tempo guidance and the duration-vs-timeline caveat. The description reinforces the prompt/tempo point but adds little parameter detail the schema does not already contain; baseline 3 applies.

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?

States a specific verb and resource ('Generate a MUSIC track for a project') plus the provider (Stable Audio via fal.ai) and its position in the workflow ('first step of the rhythm chain'). It is clearly distinguishable from siblings like lab_apply_rhythm and lab_bind_audio, which it names as downstream steps.

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?

Explicitly states when to use it (first step of the rhythm chain), how to follow up (poll lab_list_audio with audio_type 'music'), and the conditional guidance 'PUT THE TEMPO IN THE PROMPT if you intend to cut on the beat' with supporting measured evidence. It also names the three subsequent tools in order, so the agent knows what comes next.

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