Skip to main content
Glama
spotify-mcp

spotify-mcp

by codebyotto

Add tracks to a playlist (dry run by default)

add_tracks_to_playlist

Preview or add up to 20 track URIs to an existing editable Spotify playlist, validating the playlist and tracks first; dry run is default, set dry_run=false to write.

Instructions

Preview (dry_run=true, the default) or perform adding tracks to one of the user's playlists.

Both modes check that the playlist exists, that the user can edit it, and that every track URI exists, and they return the resolved track names. A dry run changes nothing. With dry_run=false the tracks are added to the live playlist. This is not idempotent: repeating the call adds the tracks again as duplicates. Recommended flow: search_tracks -> list_my_playlists/create_playlist -> this tool with dry_run=true -> user confirms -> same arguments with dry_run=false.

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": {
      "playlist_id": "<playlist_id>",
      "track_uris": "<track_uris>"
    },
    "name": "add_tracks_to_playlist"
  }
}

Input Schema

NameRequiredDescriptionDefault
dry_runNotrue (default): only validate and preview; nothing changes. false: actually add the tracks. Use false only after showing the preview to the user and getting confirmation.
positionNoZero-based insert index; omit (null) to append at the end of the playlist.
track_urisYesTrack URIs (spotify:track:<22-char id>) taken from the `uri` field of search_tracks results. 1-20 per call, added in this order.
playlist_idYes22-character Spotify playlist ID: the `id` field from list_my_playlists or create_playlist (not a name, URL or spotify:playlist: URI). The playlist must have can_edit=true.

Output Schema

NameRequiredDescriptionDefault
tracksYesTracks that would be added (dry run) or were added, in order.
dry_runYesTrue if nothing was changed (preview only).
messageYesWhat happened and what to do next.
playlistYes
positionYesInsert index; null means appended at the end.
warningsNo
snapshot_idYesPlaylist version after the change (only for real adds).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=false, idempotentHint=false, destructiveHint=false and openWorldHint=true, so the safety bar is lower, yet the description still adds real context: both modes validate playlist existence, edit permission and track URI validity, a dry run mutates nothing, and repeating the call creates duplicates. That duplicate-creation warning makes the non-idempotent annotation concrete rather than merely restated.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The default-mode qualifier is front-loaded in the title and first clause, followed by behavior, then the caveat, then the recommended flow. It is information-dense with no filler sentences; every element is either a constraint or a routing instruction.

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 4-parameter mutation tool with full schema coverage, annotations and an output schema, this covers everything an agent needs: prerequisites (editable playlist, valid URIs), side effects, non-idempotency, and the sequencing with sibling tools. Nothing about safe invocation is left unspecified.

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 schema already defines dry_run, position, track_uris and playlist_id in detail and a 3 would be the baseline. The description still adds value at the parameter level by framing dry_run as a confirmation gate ("Use false only after showing the preview to the user") and by explaining that both modes resolve and return track names, which goes beyond field-level docs.

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 names a specific verb and resource ("adding tracks to one of the user's playlists") and immediately qualifies the default mode ("dry_run=true, the default"), which is the key way this tool differs from a naive add. An agent can tell it apart from create_playlist or search_tracks without opening any schema.

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?

It gives an explicit when-to-use path ("search_tracks -> list_my_playlists/create_playlist -> this tool with dry_run=true -> user confirms -> same arguments with dry_run=false") and states the condition that selects each mode. The requirement to get user confirmation before dry_run=false is an unambiguous gating rule, not an inference.

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