Skip to main content
Glama

stretch_midi_notes

Alter MIDI note timing by scaling positions and durations around a pivot to create half-time, double-time, or custom tempo changes while preserving rhythmic relationships.

Instructions

Stretch or compress MIDI timing (half-time, double-time, or any ratio).

Each targeted note scales as a rigid unit about one fixed pivot: its distance from the pivot and its own length both multiply by factor, so the rhythm is preserved and only the speed changes. Notes that land past the item end are kept as-is; one pushed before the item start begins at the item start but keeps its scaled end, so it comes out shorter. Both are counted in out_of_bounds (clamped stays 0 here).

Args: factor: Time scale ratio, must be > 0. 2.0 = twice as long (half-time), 0.5 = half as long (double-time). pivot_beat: The fixed point, in beats from the item start; may be negative. None = the earliest targeted onset.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
factorYes
fieldsNo
channelNo
end_beatNo
pitch_lowNo
item_indexYes
pitch_highNo
pivot_beatNo
start_beatNo
track_indexYes
return_notesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.7.3

TDQS

A4/5.0
Behavior5/5

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

The description goes well beyond the minimal annotation (destructiveHint: false). It explains edge cases (notes past end, before start), how scaling works, and mentions out_of_bounds and clamped counters. This is comprehensive and non-contradictory.

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?

The description is well-structured with a clear explanation and an Args section. It is concise and each sentence adds value, though it could be slightly more compact.

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?

Given the tool's complexity (11 parameters, no output schema, minimal annotations), the description is incomplete. It does not explain the filter parameters, return structure (beyond the counters), or how notes are selected. This leaves significant gaps for an agent to infer.

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 description coverage is 0%, so the description must compensate. It explains only two of the eleven parameters (factor and pivot_beat) in detail. The other nine parameters (track_index, item_index, fields, channel, start_beat, etc.) are left unexplained, which is insufficient for correct invocation.

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 clearly states the tool's function: stretching or compressing MIDI timing with a specific ratio. It explains the behavior (scaling about a pivot) and distinguishes from siblings by focusing on time, not pitch or velocity. It is specific and actionable.

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?

The description implies usage for time-based scaling, and there is no other sibling tool that performs this exact operation. However, it does not explicitly name alternatives or provide exclusions, so it falls short of a full 5.

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