Skip to main content
Glama
MuseScore MCP Server

MuseScore MCP Server

by ghchen99

Apply Measure Repeats

apply_measure_repeats

Converts bars of one staff into 1-, 2- or 4-bar measure-repeat signs by backing up the score, writing the signs into the file and reloading it, since MuseScore's plugin API cannot place them.

Instructions

Turn bars of one staff into measure-repeat signs (1-, 2- or 4-bar) automatically. MuseScore's plugin API cannot place these signs, so this saves the score, backs the file up, writes the signs into the file and reloads it in MuseScore. The reload resets MuseScore's undo history: use restore_backup to undo. Each sign repeats the bars just before it, and the replaced bars' notes are deleted. Bars with ties or slurs crossing their barlines are skipped and reported. Pass all groups for a staff in one call.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "staff": "<staff>",
      "groups": "<groups>"
    },
    "name": "apply_measure_repeats"
  }
}

Input Schema

NameRequiredDescriptionDefault
staffYesStaff index (0-based)
groupsYesRuns of bars to replace, e.g. [{"start": 7, "end": 12, "bars": 1}]
score_pathNoPath of the score file. Defaults to the file of the score open in MuseScore.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations supplied, the description carries the full behavioral burden, and it does so thoroughly: it explains the save/backup/file-write/reload mechanism, that reloads reset undo history and restore_backup undoes it, that replaced bars' notes are deleted, and that bars with ties/slurs are skipped and reported.

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?

It is front-loaded with purpose then follows with mechanism, caveats, and a usage tip in a logical order with little filler. It is dense and slightly run-on across several claims per sentence, but essentially every sentence earns its place.

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?

For a tool that rewrites files and destroys notes, with no annotations and no output schema, the description supplies everything an agent needs: data-loss warnings, the undo path, skip/report behavior, and batching guidance.

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 adds value beyond schema by clarifying that groups' signs repeat the preceding bars, that the replaced bars' notes are deleted, and that all groups for a staff should be passed in one call.

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 states a specific verb and resource: 'Turn bars of one staff into measure-repeat signs (1-, 2- or 4-bar) automatically.' It makes the scope precise (one staff, 1/2/4-bar signs) and can be told apart from related tools like prepare_measure_repeat or collapse_to_repeat without needing to open their schemas.

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?

It gives concrete usage guidance: 'Pass all groups for a staff in one call,' and it tells the agent how to recover from the side effect by pointing to restore_backup. It does not, however, spell out explicit when-to-use-vs-sibling conditions for prepare_measure_repeat or collapse_to_repeat, so it falls short of 5.

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