Skip to main content
Glama

prepare shorter audio

audio-trims_create
Idempotent

Trim the first durationSeconds of an authorized audio asset into a new reusable asset when a lipsync needs only the opening audio.

Instructions

Save the first durationSeconds of an authorized audio asset (assetId) as a new, reusable audio asset. Use it only when audio is longer than a lipsync can take and only its beginning is needed. Not for a partial video lipsync: there, leave the original video and draft unchanged and set options.sync_mode to cut_off on lipsync_create.

Explain and confirm the partial duration first. This prepares audio only: it never generates video, spends generation credits, or consumes a free generation. Persist one idempotencyKey before calling and reuse it with identical inputs only after an uncertain response. Failed operations require an explicit new attempt.

Returns id and status (queued, processing, completed or failed) at once; assetId and durationSeconds stay null until completed, errorCode is set on failure, and retryAfterMs is the wait in milliseconds before the next read. Poll audio-trims_get until completed (jobs_get and jobs_wait do not read trims), then use its assetId and actual duration for a fresh quote.

Pass assetId, not its deprecated alias audioAssetId; the call fails when neither is given or the two name different assets. projectId saves the new asset in that project and needs projectIntent=explicit, which only an explicit user choice or a project just created for this request allows.

Input Schema

NameRequiredDescriptionDefault
assetIdNoSaved AUDIO asset to shorten, from assets_list or assets_create. Required in practice; audioAssetId is only its deprecated alias.
projectIdNoProject to save the shortened audio in, from projects_create or projects_list.
audioAssetIdNoDeprecated alias of assetId.
projectIntentNoRequired with projectId. Set only for an explicit user project selection/update, or the new project just created for this request. Never infer intent from a matching project name, workflow name or active editor.
idempotencyKeyYesA new UUID saved before the call. Reuse it with identical input only to recover an uncertain response.
durationSecondsYesSeconds to keep from the start of the audio, up to 3600.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.2.4
    • changedInput schema / properties / assetId / description
      Previous value: -"Saved AUDIO asset to shorten."New value: +"Saved AUDIO asset to shorten, from assets_list or assets_create. Required in practice; audioAssetId is only its deprecated alias."
  2. Changed3 schema fields changed
    • addedInput schema / properties / durationSeconds / description
      Added value: +"Seconds to keep from the start of the audio, up to 3600."
    • addedInput schema / properties / idempotencyKey / description
      Added value: +"A new UUID saved before the call. Reuse it with identical input only to recover an uncertain response."
    • addedInput schema / properties / projectId / description
      Added value: +"Project to save the shortened audio in, from projects_create or projects_list."
  3. Addedv0.1.5

TDQS

A4.8/5.0
Behavior5/5

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

Goes well beyond the annotations: it declares the operation never generates video, spends credits, or consumes a free generation, and it specifies idempotency semantics (persist the key first, reuse only after an uncertain response, new attempt after failure). The annotations say idempotentHint=true and readOnlyHint=false; the description explains how to realize that idempotency, which the annotation cannot.

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, then usage, then behavior, then parameter rules, in a logical order that lets an agent stop reading early. It is long and restates a few schema facts (assetId/audioAssetId aliasing, the 3600 cap is left to the schema), so a little overlap keeps it from a 5.

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 mutating job-creating tool it covers what an agent needs: confirmation of the partial duration before calling, idempotency recovery, the poll target, and the follow-up step of re-quoting with the actual duration. Because an output schema exists, it correctly avoids restating the full return shape, mentioning only the state semantics (null until completed, errorCode, retryAfterMs).

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 baseline is 3, but the description adds rule-level meaning: pass assetId rather than the deprecated audioAssetId, the call fails when neither is present or the two disagree, and projectId requires projectIntent=explicit which is only allowed for an explicit user choice or a newly created project. That paves the semantic cliff the schema alone only states tersely.

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?

"Save the first durationSeconds of an authorized audio asset (assetId) as a new, reusable audio asset" gives a precise verb, resource, and output. It also scopes itself against siblings by naming lipsync_create and distinguishing the audio-only trim from the cut_off sync mode path.

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?

States the positive condition (audio longer than lipsync can take and only its beginning is needed) and the exclusion with a concrete alternative (partial video lipsync → leave video and draft unchanged, set options.sync_mode to cut_off on lipsync_create). It also routes polling to audio-trims_get and explicitly says jobs_get and jobs_wait do not read trims, closing the most likely wrong-path.

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