Skip to main content
Glama
superseoworld

MCP Spotify Server

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
NameRequiredDescriptionDefault
localeNoOptional. Desired language (format: es_MX)
limitNoOptional. Maximum number of playlists (1-50)
offsetNoOptional. Index of the first playlist to return

Implementation Reference

  • 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)}`
      );
    }
  • 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) }],
      };
    }

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