Skip to main content
Glama

mcp_opendaw_detect_scale_from_notes

Read-only

Analyse MIDI notes to detect the musical scale or key. Uses pitch class distribution to match 15 scales and returns best match, alternatives, and confidence rating.

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?

Annotations declare readOnlyHint=true, description adds details: analyzes pitch class distribution, uses Pearson correlation, tests 15 specific scales, returns structured output with confidence rating. No contradiction.

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?

Well-structured: one-sentence summary, method explanation, list of scales, return value details, usage suggestions, parameter descriptions, and example. All sentences are relevant and concise.

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?

Despite having an output schema, the description already covers return values explicitly. Tool has only 3 parameters, and description explains all. Complete and no 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 descriptions coverage is 0%, but description explains each parameter: unit_index, track_index, region_index (with default -1 meaning first region, -2 meaning all). Provides example usage with region_index defaulting to -1.

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?

Clearly states 'detect musical scale/key from MIDI notes in a region', differentiates from sibling 'detect_key' which works on WAV audio. Provides method (Pearson correlation against 15 scales) and lists the scales.

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?

Explicitly says when to use it: before force_scale_notes, diatonic_transpose_notes, generate_melody, reharmonize_progression. Contrasts with detect_key for audio-based key detection.

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

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