Skip to main content
Glama

detect_key

Read-only

Detect musical key and scale in Ableton Live Session clips, tracks, or saved .als files via Krumhansl-Kessler correlation, with read-only analysis and optional weighting.

Instructions

Detect musical key/scale via Krumhansl-Kessler correlation (read-only).

  • scope='session' (default): pools Session MIDI clips across the live set.

  • scope='track': pools Session clips on track_index.

  • scope='clip': analyzes one Session MIDI clip (track_index, clip_index).

  • scope='als': analyzes a saved .als file offline (path, optional track_index). weight: 'duration' (default), 'velocity', 'product', or 'count'.

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_key"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathNo
scopeNosession
weightNoduration
clip_indexNo
track_indexNo

Output Schema

NameRequiredDescriptionDefault
dataYes
errorNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.0.1

TDQS

A3.9/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, and the description's '(read-only)' merely repeats that. It does add real behavioral context beyond the annotations — that clips are pooled across the live set or a track, and that scope='als' runs offline against a saved file rather than the live session.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

One lead sentence, then a tight bulleted list of scopes and a single line for weight. Front-loaded, scannable, and every line carries distinct information.

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?

An output schema exists, so return values need no explanation, and the mode/parameter matrix is otherwise well covered. What is missing is validation behavior — e.g., what happens if scope='track' is set without track_index, or whether non-MIDI clips are ignored.

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 0% schema description coverage the description must carry the load, and it largely does: all four scope values and all four weight values are enumerated with defaults and the parameters each scope expects (path for als, track_index/clip_index for track and clip). It never spells out that path is a filesystem path to a .als or what track_index indexes into, leaving small gaps.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Detect musical key/scale') plus the algorithm (Krumhansl-Kessler correlation), which makes the purpose unmistakable. It does not, however, contrast itself with analysis-adjacent siblings such as analyze_audio_file or analyze_mix, so the agent gets no explicit disambiguation.

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?

Each scope value is paired with the situation it serves and the parameters it requires (session = whole live set, track = one track, clip = one clip, als = offline file), which is effectively when-to-use guidance for the tool's modes. It stops short of exclusions or naming an alternative tool for overlapping tasks.

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