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. 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.6/5.0
Behavior5/5

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

Annotations only say this is not read-only and not destructive; the description adds substantially more — charging occurs only when confirm_cents matches the quote, failed jobs are refunded to balance but still consume the daily limit until midnight UTC, and idempotency is keyed on (token, tool, key) rather than arguments. That last point is a non-obvious behavioral trap that would otherwise cause silent wrong results.

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?

The pricing/confirmation constraint is front-loaded, and the Args/Returns structure makes scanning easy for a 5-parameter purchase tool. It loses a little to redundancy where "1-3000 chars" and "5-240 seconds" duplicate the schema's min/max constraints.

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, and the description supplies the return shape inline ({ok, job_id, kind, poll_after_s, cents}) plus the follow-up call. Combined with the billing, refund, and daily-limit rules, an agent has everything needed to invoke this safely and interpret the result.

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?

With 60% schema coverage, the description compensates well: prompt is characterized by content (genre, mood, instruments) rather than just length, and confirm_cents/idempotency_key get real semantics — including the warning that reusing a key with different arguments returns the first result. The length and duration ranges merely restate schema constraints, which is the only wasted motion.

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?

The description opens with a specific verb+resource statement — "starts one AI music track" — and immediately scopes it with billing behavior and the returned kind:'music'. An agent can tell this apart from generate_image, generate_voiceover and the music_video_* siblings without opening any 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 names the prerequisite flow explicitly: get the price from tool_cost_estimate, pass it as confirm_cents, or set quote_only=true to price without buying. It also routes the agent to wait_for_job for polling. It stops short of stating when to prefer quote_only versus a direct purchase beyond the pricing caveat, but the practical guidance is clear.

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