Skip to main content
Glama

Add melody with lyrics

add_melody

Creates new sung notes in an OpenUtau part from lyrics and an optional pitch-and-beat melody, so you can write vocal phrases with controlled timing and durations.

Instructions

Write a sung phrase as new notes from start_tick. With melody: one lyric per sounding note (must match; "+" holds a syllable; lyrics optional). Without melody: one note per lyric, with durations and tones. Use add_notes for exact notes, set_lyrics to change the words of existing notes. Returns lyrics (the split), warnings, added, part_duration, note_count. / 歌詞とメロディから新しい音符を作ります。melody ありなら音の数と歌詞の 数が一致する必要があります(「+」で伸ばす)。melody なしなら durations・tones で並べます。既存の音符の歌詞は set_lyrics。

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": {
      "part": "<part>"
    },
    "name": "add_melody"
  }
}

Input Schema

NameRequiredDescriptionDefault
partYesVoice part index from 0, counting voice parts only (see get_project voice_parts). / ボイスパート番号(0 から、ボイスパートのみ数える)
pathNoA .ustx file to edit directly (OpenUtau may be closed). Omit to use the project open in OpenUtau (needs the bridge). / 直接編集する .ustx ファイル(OpenUtau は閉じていて可)。省略で OpenUtau のプロジェクト
tonesNoWithout melody: pitch(es); a list's last value repeats (default C4 = 60). / 音高
lyricsNoLyrics text, split into one lyric per note (e.g. "さくら さくら" or "Hel-lo world"). / 歌詞テキスト
melodyNoSpace-separated PITCH:BEATS, r = rest, beats in quarter notes (decimals or 1/2), e.g. "A4:1 A4:1 B4:2 r:1/2 C5:3/2". / 「音名:拍」の並び(r = 休符)
languageNoLyric language: "auto" (default, detected), "ja" or "en". / 歌詞の言語(auto / ja / en)auto
durationsNoWithout melody: note length(s) in ticks; a list's last value repeats (default 480). / 長さ(ティック)
start_tickNoTick of the first note, relative to the part. / 最初の音符の位置

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changedv0.5.0
    • addedInput schema / properties / durations
      Added value: +{
      +  "description": "Without melody: note length(s) in ticks; a list's last value repeats (default 480). / 長さ(ティック)",
      +  "items": {
      +    "type": "integer"
      +  },
      +  "type": "array"
      +}
    • addedInput schema / properties / language / description
      Added value: +"Lyric language: \"auto\" (default, detected), \"ja\" or \"en\". / 歌詞の言語(auto / ja / en)"
    • addedInput schema / properties / lyrics / description
      Added value: +"Lyrics text, split into one lyric per note (e.g. \"さくら さくら\" or \"Hel-lo world\"). / 歌詞テキスト"
    • addedInput schema / properties / melody / description
      Added value: +"Space-separated PITCH:BEATS, r = rest, beats in quarter notes (decimals or 1/2), e.g. \"A4:1 A4:1 B4:2 r:1/2 C5:3/2\". / 「音名:拍」の並び(r = 休符)"
    • addedInput schema / properties / part / description
      Added value: +"Voice part index from 0, counting voice parts only (see get_project voice_parts). / ボイスパート番号(0 から、ボイスパートのみ数える)"
    • addedInput schema / properties / path
      Added value: +{
      +  "description": "A .ustx file to edit directly (OpenUtau may be closed). Omit to use the project open in OpenUtau (needs the bridge). / 直接編集する .ustx ファイル(OpenUtau は閉じていて可)。省略で OpenUtau のプロジェクト",
      +  "type": "string"
      +}
    • addedInput schema / properties / start_tick / description
      Added value: +"Tick of the first note, relative to the part. / 最初の音符の位置"
    • addedInput schema / properties / tones
      Added value: +{
      +  "description": "Without melody: pitch(es); a list's last value repeats (default C4 = 60). / 音高",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "part",
      -  "melody"
      -]New value: +[
      +  "part"
      +]
  2. Changed9 schema fields changedv0.4.0
    • removedInput schema / properties / language / title
      Removed value: -"Language"
    • removedInput schema / properties / lyrics / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / lyrics / default
      Removed value: -null
    • removedInput schema / properties / lyrics / title
      Removed value: -"Lyrics"
    • addedInput schema / properties / lyrics / type
      Added value: +"string"
    • removedInput schema / properties / melody / title
      Removed value: -"Melody"
    • removedInput schema / properties / part / title
      Removed value: -"Part"
    • removedInput schema / properties / start_tick / title
      Removed value: -"Start Tick"
    • removedInput schema / title
      Removed value: -"add_melodyArguments"
  3. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations only declare the mutation profile (readOnlyHint=false, destructiveHint=false, idempotentHint=false), and the description adds genuine behavioral detail: the melody/lyric count must match, '+' extends a syllable, lyrics are optional, and warnings are returned. It also discloses the return payload (lyrics split, warnings, added, part_duration, note_count). The main undisclosed behavior is whether existing notes after start_tick are shifted or overwritten.

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?

Front-loaded with the core action and the two modes, with every clause carrying information about behavior or alternatives. The sentence flow is somewhat compressed and the parenthetical '(must match;' reads as clipped, and the full Japanese restatement doubles the length without adding new semantics.

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 an 8-parameter mutation tool with no output schema, the description covers modes, constraints, return fields, and alternatives, which is close to sufficient. The one material omission is the effect on pre-existing notes at or after start_tick (insert vs overwrite), which matters for a note-creating tool.

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 would be 3, but the description adds real meaning on top: it explains how melody and lyrics interact (one lyric per sounding note, '+' for held syllables), how durations/tones are consumed when melody is absent, and that start_tick anchors the first note. That is interpretive value the schema alone does not supply.

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 ('Write a sung phrase as new notes from start_tick') and immediately splits the behavior into its two operating modes (with/without melody). It explicitly names the two sibling tools an agent might confuse it with (add_notes, set_lyrics), so selection is unambiguous.

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

Usage Guidelines5/5

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

Gives explicit routing: use add_notes for exact notes and set_lyrics to change words of existing notes, which defines both when to use this tool and when not to. It also states the mode-selection condition (melody present vs absent) that determines the call shape.

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