Skip to main content
Glama

mcp_opendaw_detect_scale_from_notes

Read-only

Find the scale or key of MIDI notes in a region by analyzing pitch-class distribution and matching against 15 common scales.

Instructions

Detect the musical scale/key from MIDI notes in a region.

Analyses the pitch class distribution of all notes in a region and matches it against 15 common scales using Pearson correlation. Unlike detect_key (which works on WAV audio), this works directly on MIDI note data — no audio file needed.

Scales tested (15):

  • major, natural_minor, harmonic_minor, melodic_minor

  • dorian, phrygian, lydian, mixolydian, locrian

  • pentatonic_major, pentatonic_minor, blues

  • hungarian_minor, double_harmonic, whole_tone

Returns:

  • best_match: {scale, root, correlation} — highest scoring scale

  • alternatives: top 5 matches with correlation scores

  • pitch_class_histogram: 12-bin histogram of note pitches

  • note_count: total notes analysed

  • chromatic_coverage: how many of 12 pitch classes are used

  • confidence: qualitative rating (high/medium/low based on correlation)

Use this before:

  • force_scale_notes (to know which scale to force)

  • diatonic_transpose_notes (to know the correct scale)

  • generate_melody (to match existing material's scale)

  • reharmonize_progression (to pick the right key)

unit_index: AU index. track_index: Note track index. region_index: Region index (-1 = first region, -2 = all regions on track).

Example: scale = detect_scale_from_notes(0, 0)

best_match: {scale: "natural_minor", root: "A", correlation: 0.87}

→ use force_scale_notes(root="A", scale="natural_minor")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
unit_indexYes
track_indexYes
region_indexNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

The description explains the analysis method (pitch class distribution, Pearson correlation, 15 scales) and discloses the full return structure including confidence rating. It adds substantial behavioral context beyond the readOnlyHint annotation, without contradicting it.

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?

The description is long but well-structured with clear sections: purpose, method, scale list, return fields, use-before list, parameter definitions, and a concrete example. Every section earns its place and the core statement is front-loaded.

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 the tool's full behavior: what input it needs, what analysis it performs, what it returns, how it relates to other tools, and a usage example. Given the tool's analytical complexity and the sparse schema, this description is complete and leaves no essential gaps.

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?

Schema description coverage is 0%, but the description provides meaningful explanations for all three parameters: unit_index (AU index), track_index (Note track index), and region_index with special values (-1 = first region, -2 = all regions). This fully compensates for the schema's lack of descriptions.

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 opens with a specific verb+resource statement: 'Detect the musical scale/key from MIDI notes in a region.' It also explicitly distinguishes itself from the sibling tool detect_key, which works on WAV audio, making the tool's purpose and scope unmistakable.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It directly contrasts with detect_key (audio vs MIDI) and provides an explicit 'Use this before' list naming force_scale_notes, diatonic_transpose_notes, generate_melody, and reharmonize_progression. This gives clear when-to-use guidance and alternatives.

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