Skip to main content
Glama

modify_playlist

Update Spotify playlist details including name, visibility, collaboration settings, and description using the playlist ID.

Instructions

Change a playlist's name and public/private state

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe Spotify ID or URI of the playlist
nameNoOptional. New name for the playlist
publicNoOptional. If true the playlist will be public
collaborativeNoOptional. If true, the playlist will become collaborative
descriptionNoOptional. New description for the playlist

Implementation Reference

  • The core handler function that modifies a playlist's name, public status, collaborative status, or description by sending a PUT request to the Spotify API /playlists/{id} endpoint.
    async modifyPlaylist(args: ModifyPlaylistArgs) { const playlistId = this.extractPlaylistId(args.id); const { name, public: isPublic, collaborative, description } = args; const data = { ...(name !== undefined && { name }), ...(isPublic !== undefined && { public: isPublic }), ...(collaborative !== undefined && { collaborative }), ...(description !== undefined && { description }) }; return this.api.makeRequest( `/playlists/${playlistId}`, 'PUT', data ); }
  • TypeScript interface defining the input arguments for the modify_playlist tool, including required playlist ID and optional fields for modification.
    export interface ModifyPlaylistArgs { id: string; name?: string; public?: boolean; collaborative?: boolean; description?: string; }
  • src/index.ts:527-556 (registration)
    MCP tool registration in the ListTools response, defining the name, description, and input schema for the modify_playlist tool.
    { name: 'modify_playlist', description: 'Change a playlist\'s name and public/private state', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'The Spotify ID or URI of the playlist' }, name: { type: 'string', description: 'Optional. New name for the playlist' }, public: { type: 'boolean', description: 'Optional. If true the playlist will be public' }, collaborative: { type: 'boolean', description: 'Optional. If true, the playlist will become collaborative' }, description: { type: 'string', description: 'Optional. New description for the playlist' } }, required: ['id'] }, },
  • src/index.ts:853-859 (registration)
    Dispatch handler in the CallToolRequest that validates arguments and calls the playlistsHandler.modifyPlaylist method.
    case 'modify_playlist': { const args = this.validateArgs<ModifyPlaylistArgs>(request.params.arguments, ['id']); const result = await this.playlistsHandler.modifyPlaylist(args); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/superseoworld/mcp-spotify'

If you have feedback or need assistance with the MCP directory API, please join our Discord server