Skip to main content
Glama

mcp_opendaw_detect_key

Read-only

Detect the musical key and mode of a WAV audio file using chroma analysis and Krumhansl-Schmuckler profiles. Returns key, mode, and confidence to enable harmonic matching and chord progression creation.

Instructions

Detect musical key and mode of a WAV file using chroma features + Krumhansl-Schmuckler key profiles.

Pure Python implementation (no external dependencies):

  1. Parse WAV → mono mixdown

  2. Short-time FFT (4096-point, Hann window, 75% overlap) — pure Python radix-2 Cooley-Tukey

  3. Map spectral bins to 12 pitch classes → chroma vector

  4. Correlate chroma with major/minor key profiles for all 24 keys (12 roots × 2 modes)

  5. Best correlation → key + mode

Essential for Suno integration: detect key → build matching chord progression → create_harmonic_arrangement that fits the imported audio. Enables automatic remix pipeline: download → detect_bpm → detect_key → import → generate matching harmony → mix → render.

filename: Name of the WAV file in the exports directory (without path), or absolute path to any WAV file.

Returns: key (e.g. "A"), mode ("major"/"minor"), confidence (0-1), correlation, alternatives (top 3), chroma (12-element list).

Examples:

After importing a Suno track

result = detect_key("suno_track.wav")

→ {key: "A", mode: "minor", confidence: 0.72, ...}

Then build matching progression

create_chord_progression([["Am","G","F","E7"]])

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filenameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

The annotation readOnlyHint=true is consistent with the description. The description adds significant behavioral context: pure Python implementation, no external dependencies, and a step-by-step algorithm (FFT, chroma, correlation). It also details the return fields, going beyond the annotation's safety profile.

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?

The description is lengthy but well-structured, starting with the core purpose, then algorithm, use case, parameter, and return format. The numbered algorithm steps could be trimmed but add transparency. Examples at the end are useful.

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?

The description covers input, output, use case, and algorithm. It even includes an example result. With a single parameter and an output schema, this is complete for an agent to select and invoke the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has only one parameter 'filename' with no description, so the description carries full burden. It fully explains: 'Name of the WAV file in the exports directory (without path), or absolute path to any WAV file.' This provides clear semantics beyond the raw 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 tool's function: 'Detect musical key and mode of a WAV file using chroma features + Krumhansl-Schmuckler key profiles.' This is a specific verb+resource+method, distinguishing it from sibling tools like detect_bpm and analyze_track.

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 a clear use case: 'Essential for Suno integration: detect key → build matching chord progression → create_harmonic_arrangement that fits the imported audio.' It also places it in a remix pipeline. However, it does not explicitly name alternatives or when-not-to-use, stopping short of a 5.

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/ameobius-ai/opendaw-mcp'

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