Skip to main content
Glama

Generate music

generate_music

Costs a flat price per track, charged only after confirm_cents matches the quote: starts one AI music track.

Args: prompt: 1-3000 chars (genre, mood, instruments). duration_s: 5-240 seconds. A hint only: the model decides the real length and often makes a full song of about two minutes whatever you ask; the price is the same. The Library item says the real length. confirm_cents: the price the user agreed to (from tool_cost_estimate); 0 with quote_only. idempotency_key: unique per purchase; a retry with the same key never buys twice. Idempotency is keyed on (this token, this tool, idempotency_key), not on the arguments: reusing an idempotency_key with different arguments returns the first result. quote_only: true returns the price and buys nothing.

Returns: {ok, job_id, kind:'music', poll_after_s, cents}: poll with wait_for_job; the track lands in your Library A job that fails is refunded to the balance, but it still counts toward this token's daily limit until midnight UTC.

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": {
      "prompt": "<prompt>",
      "duration_s": "<duration_s>",
      "confirm_cents": "<confirm_cents>"
    },
    "name": "generate_music"
  }
}

Input Schema

NameRequiredDescriptionDefault
promptYes
duration_sYes
quote_onlyNotrue: return the price and buy nothing.
confirm_centsYesThe price in cents the user agreed to, from tool_cost_estimate or a quote_only call. Pass 0 with quote_only.
idempotency_keyNoAny unique string per purchase; a retry with the same key never buys twice.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Goes far beyond the annotations: it discloses the billing trigger, that duration_s is only a hint and the model often returns ~2 minutes regardless (with no price change), that idempotency is keyed on (token, tool, key) rather than arguments so a reused key with different args returns the first result, and that failed jobs refund but still consume the daily limit until midnight UTC. The annotations only say readOnly=false/destructive=false; the description supplies all the consequential behavior.

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?

Structured as a front-loaded cost summary followed by Args and Returns blocks, with essentially no filler. Minor deduction: the opening sentence buries the verb ("starts one AI music track") after the billing clause, making the first read slightly awkward.

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, yet the description spells out the return shape ({ok, job_id, kind, poll_after_s, cents}) and tells the agent which tool to poll with. For a paid, multi-step tool it also covers the failure/refund and quota edge cases an agent would otherwise discover only by erroring.

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 60%, and the description fills the gaps: prompt is bounded 1-3000 chars with expected content (genre, mood, instruments), duration_s gets the crucial "hint only, real length is in the Library item" caveat, and confirm_cents is tied to the quote/quote_only flow. The idempotency_key note about keying on token+tool rather than arguments adds semantics the schema does not.

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?

"Starts one AI music track" gives a specific verb and resource, and the pricing clause ("flat price per track, charged only after confirm_cents matches the quote") instantly separates it from sibling generators like generate_image or generate_video_clip. An agent knows what this produces and what it costs without opening the schema.

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?

It lays out the intended flow explicitly: get a price from tool_cost_estimate or a quote_only call, pass the agreed amount as confirm_cents, then poll with wait_for_job. What's absent is any statement of when to prefer this over a non-generative music sibling, but the workflow guidance itself is clear and actionable.

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