get_current_user_playlists
Retrieve a list of playlists owned or followed by the current Spotify user, with options to limit results and offset starting position for pagination.
Instructions
Get a list of the playlists owned or followed by the current Spotify user
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of playlists to return (1-50) | |
| offset | No | The index of the first playlist to return |
Implementation Reference
- src/handlers/playlists.ts:104-115 (handler)The core handler function that implements the tool logic by making a Spotify API request to /me/playlists with pagination parameters.async getCurrentUserPlaylists(args: GetCurrentUserPlaylistsArgs) { const { limit, offset } = args; const params = { ...(limit !== undefined && { limit }), ...(offset !== undefined && { offset }) }; return this.api.makeRequest( `/me/playlists${this.api.buildQueryString(params)}` ); }
- src/types/playlists.ts:40-43 (schema)TypeScript interface defining the input arguments for the get_current_user_playlists tool, extending PaginationParams.export interface GetCurrentUserPlaylistsArgs extends PaginationParams { limit?: number; offset?: number; }
- src/index.ts:877-883 (registration)Dispatch handler in the main switch statement that routes the tool call to the playlistsHandler.getCurrentUserPlaylists method.case 'get_current_user_playlists': { const args = this.validateArgs<GetCurrentUserPlaylistsArgs>(request.params.arguments || {}, []); const result = await this.playlistsHandler.getCurrentUserPlaylists(args); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; }
- src/index.ts:620-639 (registration)Tool registration in the ListTools response, defining the name, description, and input schema for the tool.{ name: 'get_current_user_playlists', description: 'Get a list of the playlists owned or followed by the current Spotify user', inputSchema: { type: 'object', properties: { limit: { type: 'number', description: 'Maximum number of playlists to return (1-50)', minimum: 1, maximum: 50 }, offset: { type: 'number', description: 'The index of the first playlist to return', minimum: 0 } } }, },