Skip to main content
Glama

get_audio_duration

Read-onlyIdempotent

Measures an audio file's duration in milliseconds and seconds to calculate timing before recording, so you can pace video movements to a voiceover.

Instructions

[Cinematic Engine] Get the duration of an audio file in milliseconds.

Use this to calculate timing for video recording - know how long a voiceover is BEFORE starting to record, so you can pace movements.

Args: path: Absolute path to the audio file (MP3, WAV, etc.)

Returns: {"success": True, "data": {"duration_ms": 3500, "duration_sec": 3.5}}

Requires: pip install browser-director[video]

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": {
      "path": "<path>"
    },
    "name": "get_audio_duration"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYes

Output Schema

NameRequiredDescriptionDefault
dataNo
hintsNo
messageNo
successNo
suggestionsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent and non-destructive, so the bar is lower; the description adds genuinely new context such as the required pip extra and the JSON response shape. It does not say what happens for a missing, unsupported or unreadable file, which is the main remaining gap.

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?

Purpose and usage are front-loaded in two sentences, followed by tidy Args/Returns/Requires blocks. The Returns block partly duplicates the output schema and the install note is marginal, but nothing is confusing.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-parameter read tool with full annotation coverage and an output schema, the definition supplies everything needed to invoke it: purpose, timing use case, path format, return shape and dependency. Only error-path behavior 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 0% (the single `path` property is undocumented), so the description must compensate and largely does: it specifies an absolute path and lists accepted formats (MP3, WAV, etc.). It stops short of clarifying whether relative paths fail or how the path is resolved.

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 ("Get the duration of an audio file") plus the unit returned (milliseconds), which immediately distinguishes it from the sibling get_video_duration. An agent can pick this tool 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?

Gives a concrete when-to-use condition: measure a voiceover BEFORE recording so camera movements can be paced. It does not explicitly name get_video_duration as the alternative for video files, so the routing guidance is clear but not complete.

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