Skip to main content
Glama
boraswim
by boraswim

add_pattern

Adds a pattern of notes to a song and returns its index; notes must fit the selected key and scale, and the pattern plays only when the arrangement uses it.

Instructions

Adds a pattern and returns its index. It won't play until the arrangement uses it. Notes are absolute pitches, so the key and scale don't move them; they must fit that key and scale.

Input Schema

NameRequiredDescriptionDefault
keyNoKey, like "C", "F#" or "Bb". Ignored for drumkits.
notesNoUp to 128 notes.
scaleNoScale. Notes must fit it. Ignored for drumkits. One of: normal (all notes), major, minor (melodic, with a raised 6th and 7th; for natural minor, use the relative major's key with scale major), blues, harmonic minor, pentatonic major, pentatonic minor, pentatonic blues, pentatonic neutral, romanian folk, spanish gypsy, arabic magam, chinese, hungarian, chord: major, chord: minor, chord: 5th, chord: dom 7th, chord: major 7th, chord: minor 7th, chord: minor major 7th, chord: sus4, chord: sus2.
instrumentNoIndex of the song's instrument, 0 by default.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare this is a non-read-only, non-destructive, closed-world mutation. The description adds meaningful behavioral context beyond that: it returns the new pattern's index, the pattern is silent until used in the arrangement, and notes are absolute pitches constrained by key and scale.

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 three tight sentences with the core action and return value front-loaded. Every sentence carries useful information and there is no filler.

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?

For a moderate-complexity tool with full schema coverage and no output schema, the description covers the return value, workflow implication, and key note constraints. It leaves out sibling alternatives and drumkit-specific handling, which the schema covers but an agent comparing tools might still want in the description.

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 100%, so the baseline is 3. The description still adds value by explaining that notes are absolute pitches, that key and scale do not transpose them, and that notes must fit the selected key and scale.

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?

The description clearly states the verb and resource: it adds a pattern and returns its index. It does not explicitly differentiate itself from the very similar sibling clone_pattern, so it falls short of a 5.

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

Usage Guidelines3/5

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

The line 'It won't play until the arrangement uses it' hints at the workflow after adding a pattern, but the description never states when to use add_pattern instead of clone_pattern, import_midi, or other creation paths. Usage is implied rather than explicitly guided.

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