get_featured_playlists
Retrieve Spotify's featured playlists to discover curated music collections. Filter results by locale, limit, and offset for customized browsing.
Instructions
Get a list of Spotify featured playlists
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| locale | No | Optional. Desired language (format: es_MX) | |
| limit | No | Optional. Maximum number of playlists (1-50) | |
| offset | No | Optional. Index of the first playlist to return |
Implementation Reference
- src/handlers/playlists.ts:117-129 (handler)The core handler function that implements the logic for fetching featured playlists from the Spotify Browse API endpoint /browse/featured-playlists, constructing query parameters from input args.async getFeaturedPlaylists(args: GetFeaturedPlaylistsArgs) { const { locale, limit, offset } = args; const params = { ...(locale !== undefined && { locale }), ...(limit !== undefined && { limit }), ...(offset !== undefined && { offset }) }; return this.api.makeRequest( `/browse/featured-playlists${this.api.buildQueryString(params)}` ); }
- src/types/playlists.ts:45-49 (schema)TypeScript interface defining the optional input parameters (locale, limit, offset) for the get_featured_playlists tool.export interface GetFeaturedPlaylistsArgs { locale?: string; limit?: number; offset?: number; }
- src/index.ts:640-663 (registration)Registration of the get_featured_playlists tool in the MCP server's ListTools response, including name, description, and input schema.{ name: 'get_featured_playlists', description: 'Get a list of Spotify featured playlists', inputSchema: { type: 'object', properties: { locale: { type: 'string', description: 'Optional. Desired language (format: es_MX)' }, limit: { type: 'number', description: 'Optional. Maximum number of playlists (1-50)', minimum: 1, maximum: 50 }, offset: { type: 'number', description: 'Optional. Index of the first playlist to return', minimum: 0 } } }, },
- src/index.ts:885-891 (registration)Dispatch logic in the CallToolRequestSchema handler that validates arguments and delegates to the playlistsHandler.getFeaturedPlaylists method.case 'get_featured_playlists': { const args = this.validateArgs<GetFeaturedPlaylistsArgs>(request.params.arguments || {}, []); const result = await this.playlistsHandler.getFeaturedPlaylists(args); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; }