Obtain a user-authorized access token with at least the playlist-modify-public or playlist-modify-private scope via the Authorization Code or PKCE flow.
Create the playlist by sending a POST request to the endpoint for a user's playlists (/v1/users/{user_id}/playlists), providing name, public flag, and optional description in the JSON body.
Note the playlist id returned in the response.
Gather the Spotify URI strings (spotify:track:{id}) for the tracks you wish to add.
Add tracks by sending a POST request to the playlist items endpoint (/v1/playlists/{playlist_id}/tracks) with a JSON body containing a uris array of track URIs.
To add more than 100 tracks, batch requests into groups of up to 100 URIs per call.
Known gotchas
A single add-items request accepts a maximum of 100 track URIs; split larger additions into multiple sequential requests.
The playlist creation endpoint requires the user's Spotify user ID in the URL path, not just the access token.
Modifying a collaborative or private playlist requires the appropriate scope; a missing scope returns a 403 Forbidden error.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp