Skip to main content
Glama

Detect beats

detect_beats

Finds beat times in an After Effects Audio Amplitude layer by detecting amplitude peaks above a threshold and spacing them by a minimum gap; optionally adds markers and returns average BPM.

Instructions

Find beats/peaks in an 'Audio Amplitude' layer (from audio_to_keyframes; created automatically from 'audioLayer' when missing): samples the channel slider per frame and picks local peaks above threshold (fraction of the max, default 0.5) at least minGap seconds apart (default 0.25). Optionally adds a comp (or layer) marker per beat. Returns beat times in seconds and an average BPM.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "detect_beats"
  }
}

Input Schema

NameRequiredDescriptionDefault
compNoComposition name, 'Folder/Name' path, or item id. Omit to use the active composition.
limitNoMax beats returned (default 500).
detailNoAlso return frame and amplitude per beat.
minGapNoMinimum seconds between beats (default 0.25).
channelNoChannel slider to analyse (default 'both').
endTimeNoAnalyse until this time (default comp end).
startTimeNoAnalyse from this time (default 0).
thresholdNoPeak threshold as a fraction of the max amplitude (default 0.5).
addMarkersNoAdd a marker at every beat.
audioLayerNoAudio layer to convert when there is no amplitude layer yet.
markerLabelNoMarker label color index.
markerLayerNoPut beat markers on this layer instead of the comp.
markerCommentNoMarker comment (default 'beat'); a running number is appended unless numberMarkers=false.
numberMarkersNoAppend the beat number to the comment (default true).
amplitudeLayerNoAudio Amplitude layer (default: the first one in the comp).
absoluteThresholdNoAbsolute slider value threshold (overrides threshold).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations only declare readOnlyHint=false / destructiveHint=false / openWorldHint=false, which is a low bar; the description contributes real behavior beyond that — it discloses that the tool may silently create an amplitude layer, that it can write markers into the comp or a target layer, and that it returns beat times plus an average BPM. It stops short of saying what happens to pre-existing markers on the target or how a 500-beat limit truncates results, which keeps it off a 5.

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 the verb and target, then a single dense sentence covering algorithm, defaults, and return value — virtually no filler. The nested parentheses around defaults and the fallback clause make it slightly harder to scan than it needs to be, but nothing is wasted.

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 16-parameter tool with no output schema, the description covers the essentials: what input it needs, how peaks are chosen, side effects (layer creation, markers), and the return shape (times plus average BPM). The remaining gap is minor — truncation behavior when limit is hit and what detail=true changes are left entirely to the schema.

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 3 is the baseline, but the description adds the interaction semantics neither field carries alone: a beat must clear the threshold (a fraction of max amplitude) AND be at least minGap seconds from the previous beat. It also documents the audioLayer-to-amplitudeLayer fallback chain, which the schema text does not connect. Parameters like limit, detail, markerLabel and absoluteThreshold are only covered by the schema.

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?

Uses a specific verb-and-resource pair ('Find beats/peaks in an Audio Amplitude layer') and immediately states the operating domain — it samples a channel slider per frame and picks local peaks. It also explicitly positions itself relative to the producer sibling (audio_to_keyframes) and the fallback input ('audioLayer'), so an agent can distinguish it from generic marker tools like add_markers_bulk.

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?

The description gives the key precondition: it needs an Audio Amplitude layer, which is created automatically from 'audioLayer' when missing, so the agent knows it can call this without a prior conversion step. It doesn't name exclusion cases — e.g. when to prefer add_markers_bulk or manual marker placement — but the trigger conditions are clear enough to select the tool confidently.

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

Deploy Server

Other Tools