Skip to main content
Glama

detect_clip_key

Read-only

Analyze a MIDI clip in Ableton Live to detect its key and scale using the Krumhansl-Kessler algorithm. Returns the best-fit key, confidence, and margin over the runner-up.

Instructions

Detect the key/scale of one Session MIDI clip (Krumhansl-Kessler). Reads the clip's notes and returns the best-fit key with a confidence (-1..1), margin over the runner-up, and the runner-up key. weight is how notes are weighted into the pitch-class histogram: "duration" (default), "velocity", "product", or "count". Reads only; changes nothing.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
weightNoduration
clip_indexYes
track_indexYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

Aligns with annotations (readOnlyHint: true) by stating 'Reads only'. Adds detailed behavioral context: algorithm (Krumhansl-Kessler), return values (best-fit key, confidence range -1..1, margin, runner-up), and weight parameter effect. No contradictions.

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?

Three sentences, front-loaded with the primary action, no redundant text. Efficiently conveys purpose, behavior, and parameter guidance.

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?

Given the presence of an output schema, the description adequately covers return values. However, it omits edge cases (e.g., empty clips) and does not explicitly require the clip to be MIDI. Still, it is mostly complete for a straightforward read-only tool.

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%, but the description explains the weight parameter's possible values ('duration', 'velocity', 'product', 'count') and its role in pitch-class histogram weighting. For clip_index and track_index, context from the tool name and description implies their meaning as clip identifiers. Adds significant value beyond the bare 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?

The description clearly states the verb 'detect', the resource 'key/scale of one Session MIDI clip', and the algorithm (Krumhansl-Kessler). It distinguishes from sibling tools like 'als_detect_key' and 'detect_session_key' by specifying it operates on a single clip in Session view using track and clip indices.

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 explicitly states 'Reads only; changes nothing,' clarifying appropriate use cases. While it doesn't list alternative tools, the context of session clip focus vs. sibling tools like 'detect_track_key' provides implicit guidance. Some explicit when-not-to-use would improve it.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/wstierhout/ableton-live-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server