Skip to main content
Glama

Musicboxmelodies

Fit a melody to a music box

fit_melody_to_box
Read-only

Adjusts a melody so it can be played on a music box and lists every change. Strategies: "transpose" (shift the whole melody to the key that fits best), "nearest_note" (move each unplayable note to the closest playable one), "transpose_then_nearest" (default: both). Optionally snaps notes to a grid. Returns the new melody and its validation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
boxYesMusic box type: "15", "20", "30" (notes) or "freestyle" (digital only). See list_music_boxes.
bpmYesTempo in beats per minute (30-300).
notesYesNotes in any order, at most 2000. Only onsets matter: music boxes have no note durations.
strategyNo
target_boxNoBox to fit into. Defaults to the melody's box.
quantize_beatsNoSnap every note to this grid in beats (e.g. 0.5 = eighth notes).
illegal_threshold_ticksNoMinimum gap between two identical notes, in ticks (default 384 = 2 beats).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
melodyYes
changesYes
summaryYes
semitonesYes
validationYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare this is a read-only, closed-world operation, and the description is consistent with that. It adds real behavioral context beyond the annotations: it reports every change made and returns the new melody plus its validation. Does not discuss determinism or reproducibility of the fit.

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?

Three tight sentences: purpose first, then the strategy semantics, then the optional quantization. Front-loaded and free of filler, though the strategy parenthetical is slightly dense to parse.

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 7-parameter tool with an output schema, the description covers the decision-relevant parts (strategy choice, quantization, target box behavior) so an agent can call it correctly. It does not need to restate return values since an output schema exists.

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 high (86%), so the baseline is 3, but the description earns extra credit by defining the strategy enum's three values and the default, which the schema leaves undocumented, and by explaining the optional grid snapping.

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?

States a specific verb and resource ('Adjusts a melody so it can be played on a music box') plus the side effect ('lists every change'). This is clearly distinct from validate_melody and list_music_boxes, though it never names a sibling to sharpen the contrast.

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?

Gives clear operating context: use the strategy enum to choose transpose/nearest_note/transpose_then_nearest, and note the default. No explicit when-not-to-use or routing to alternatives such as validate_melody for a check-only path.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources