Skip to main content
Glama

write_melody

Compose a melody over chords: generates rhythmic motifs, phrases, chord-tone strong beats, stepwise lines, and a closing tonic. Use seeds to explore variations.

Instructions

Composes a melody over chords: a rhythmic motif developed in phrases, chord tones on strong beats, stepwise lines with leaps recovered, a high point, a half-close at the end of the first phrase and the tonic at the end. Try several seeds.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyNoKey with any scale or mode: 'A minor', 'F# dorian', 'Bb', 'Eb mixolydian', 'C harmonic minor'
lowNoLowest note, e.g. C4 (vocal-like), A3C4
highNoHighest note, e.g. G5G5
seedNoSame seed, same melody; change it for another idea
scaleNoScale the melody uses, e.g. 'minor pentatonic', 'blues'; default: the key's
startNo
chordsYesChords with lengths, or one string like 'Am7 D7 Gmaj7' / 'ii7-V7-Imaj7' (each lasting chord_length).
densityNoHow many notes per barmedium
item_idYesMIDI item id from create_midi_item/get_track_details, or "selected"
replaceNo
velocityNo
phrase_barsNoPhrase length: the motif repeats and the phrase closes every this many bars
syncopationNo
chord_lengthNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.19.1

TDQS

B3.4/5.0
Behavior3/5

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

No annotations are present, so the description carries the full burden. It does disclose real output behavior (motif development, chord tones on strong beats, stepwise recovery, half-close then tonic) and hints at non-determinism via 'Try several seeds'. However it omits key operational behavior: that a MIDI item must already exist (item_id required), what replace=true destroys, and what the call actually writes.

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?

Two sentences, purpose front-loaded, and the long stylistic clause is at least substantive rather than filler. 'Try several seeds' is an actionable closing line. Slightly dense but no wasted sentences.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 14-parameter generative mutation tool with no annotations and no output schema, the description is thin on essentials: it never states the item must exist first, whether existing notes are preserved or overwritten, or what the tool returns/where the notes land (e.g. into the MIDI item). Understanding the musical output is good, but the operational picture is incomplete.

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

Parameters2/5

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

Schema coverage is only 64%, so the schema does not fully carry the load, and the description adds almost no parameter-level meaning beyond the seed hint ('try several seeds'). Params with no description anywhere (replace, velocity, syncopation, chord_length, top-level start) are left unexplained, so the description does not compensate for the coverage gap.

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?

States a specific verb and resource ('Composes a melody'), and 'over chords' precisely scopes the operation so it is separable from siblings like harmonize_melody (which derives chords from a melody) and write_bassline. The melodic-characteristics clause reinforces what kind of melody is produced rather than merely restating the name.

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?

Usage is only implied: the description makes clear you need chords to compose over, and 'Try several seeds' is a usable generation tip. There is no explicit when-to-use/when-not versus harmonize_melody, add_midi_notes, or save_motif, and no prerequisites are named.

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

Deploy Server

Other Tools