Skip to content
All tools

music_add_to_playlist

Music · macOS

Effect: write (strongest supported action). Status: gated.

Gated means the tool requires an installed app, a connected account, permission, or runtime availability. Check those requirements on the listed platform before using it.

macOS

Purpose

Adds library tracks to a playlist of the Music app, in the order given. Called without confirm it returns a preview and adds nothing; pass confirm=true to add. `playlist` is a name or an id; when no playlist has that name, create=true creates it, and without it nothing is added. Smart playlists, folders and playlists the Music app manages are refused. When any track id is not in the library, nothing is added. A track that is already in the playlist is added again. Opens the Music app when it is closed.

Required inputs

Permissions and confirmation

Explicit confirmation parameter: inspect the schema and tool description before any real call. The documentation example keeps confirm false. Obtain user authorization before performing the action.

Full input schema — macOS
{
  "properties": {
    "confirm": {
      "description": "Must be true to act. Without it, returns a preview and changes nothing.",
      "type": "boolean"
    },
    "create": {
      "description": "Create the playlist when none has that name (default false).",
      "type": "boolean"
    },
    "playlist": {
      "description": "Playlist name or id from music_list_playlists.",
      "type": "string"
    },
    "track_ids": {
      "description": "Track ids from music_search_library (at most 100).",
      "items": {
        "type": "string"
      },
      "type": "array"
    }
  },
  "required": [
    "playlist",
    "track_ids"
  ],
  "type": "object"
}

Documentation example

Do not execute this example. These concrete inputs refer to a fictional demonstration dataset. Resolve real handles and obtain user authorization before any real call.

{
  "confirm": false,
  "create": true,
  "playlist": "Demo Focus",
  "track_ids": [
    "demo-track-001",
    "demo-track-002"
  ]
}