Add tracks to a playlist (dry run by default)
add_tracks_to_playlistPreview 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
| Name | Required | Description | Default |
|---|---|---|---|
| dry_run | No | true (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. | |
| position | No | Zero-based insert index; omit (null) to append at the end of the playlist. | |
| track_uris | Yes | Track URIs (spotify:track:<22-char id>) taken from the `uri` field of search_tracks results. 1-20 per call, added in this order. | |
| playlist_id | Yes | 22-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
| Name | Required | Description | Default |
|---|---|---|---|
| tracks | Yes | Tracks that would be added (dry run) or were added, in order. | |
| dry_run | Yes | True if nothing was changed (preview only). | |
| message | Yes | What happened and what to do next. | |
| playlist | Yes | ||
| position | Yes | Insert index; null means appended at the end. | |
| warnings | No | ||
| snapshot_id | Yes | Playlist version after the change (only for real adds). |