Skip to main content
Glama

get_categories

Retrieve Spotify's music categories to build browsing interfaces, discover genres, and create organized music discovery experiences with classification data.

Instructions

Explore all available music categories that Spotify uses to organize and classify playlists and content.

🎯 USE CASES: β€’ Build category-based music browsing interfaces β€’ Discover music genres and style classifications β€’ Create organized music discovery experiences β€’ Research music categorization and taxonomy β€’ Build genre-specific playlist recommendation systems

πŸ“ WHAT IT RETURNS: β€’ Complete list of Spotify's music categories β€’ Category names, descriptions, and representative icons β€’ Genre classifications and style groupings β€’ Category popularity and playlist counts β€’ Links to explore category-specific content

πŸ” EXAMPLES: β€’ "Show me all music categories on Spotify" β€’ "Get browse categories for music discovery" β€’ "What genres and categories are available?" β€’ "List all music classification categories"

πŸ—‚οΈ CATEGORY TYPES: β€’ Genre categories: Rock, Pop, Hip-Hop, Electronic, etc. β€’ Mood categories: Chill, Party, Focus, Sleep, etc. β€’ Activity categories: Workout, Commute, Gaming, etc. β€’ Demographic categories: Kids, Decades, Regional, etc. β€’ Special categories: New Releases, Charts, Discover, etc.

πŸ’‘ ORGANIZATION BENEFITS: β€’ Systematic approach to music discovery β€’ Clear classification for different musical styles β€’ Perfect for building browsing interfaces β€’ Helps users navigate vast music catalogs β€’ Professional categorization system

🎯 USE IN APPLICATIONS: β€’ Create category-based navigation menus β€’ Build genre-specific recommendation engines β€’ Organize music content systematically β€’ Provide structured music discovery experiences

⚠️ REQUIREMENTS: β€’ Valid Spotify access token β€’ Categories reflect current Spotify organization

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tokenYesSpotify access token for authentication
limitNo
countryNoCountry code for localized content (e.g., 'US', 'GB')

Implementation Reference

  • Registration of the 'get_categories' MCP tool within the playlistTools object, including title, description, schema, and handler.
    get_categories: { title: "Get Browse Categories", description: `Explore all available music categories that Spotify uses to organize and classify playlists and content. 🎯 USE CASES: β€’ Build category-based music browsing interfaces β€’ Discover music genres and style classifications β€’ Create organized music discovery experiences β€’ Research music categorization and taxonomy β€’ Build genre-specific playlist recommendation systems πŸ“ WHAT IT RETURNS: β€’ Complete list of Spotify's music categories β€’ Category names, descriptions, and representative icons β€’ Genre classifications and style groupings β€’ Category popularity and playlist counts β€’ Links to explore category-specific content πŸ” EXAMPLES: β€’ "Show me all music categories on Spotify" β€’ "Get browse categories for music discovery" β€’ "What genres and categories are available?" β€’ "List all music classification categories" πŸ—‚οΈ CATEGORY TYPES: β€’ Genre categories: Rock, Pop, Hip-Hop, Electronic, etc. β€’ Mood categories: Chill, Party, Focus, Sleep, etc. β€’ Activity categories: Workout, Commute, Gaming, etc. β€’ Demographic categories: Kids, Decades, Regional, etc. β€’ Special categories: New Releases, Charts, Discover, etc. πŸ’‘ ORGANIZATION BENEFITS: β€’ Systematic approach to music discovery β€’ Clear classification for different musical styles β€’ Perfect for building browsing interfaces β€’ Helps users navigate vast music catalogs β€’ Professional categorization system 🎯 USE IN APPLICATIONS: β€’ Create category-based navigation menus β€’ Build genre-specific recommendation engines β€’ Organize music content systematically β€’ Provide structured music discovery experiences ⚠️ REQUIREMENTS: β€’ Valid Spotify access token β€’ Categories reflect current Spotify organization`, schema: createSchema({ token: commonSchemas.token(), limit: commonSchemas.limit(1, 50, 20), country: commonSchemas.country(), }), handler: async (args: any, spotifyService: SpotifyService) => { const { token, limit = 20, country } = args; return await spotifyService.getCategories(token, limit, country); }, },
  • The handler function for the 'get_categories' tool, which extracts arguments and delegates to SpotifyService.getCategories.
    handler: async (args: any, spotifyService: SpotifyService) => { const { token, limit = 20, country } = args; return await spotifyService.getCategories(token, limit, country); },
  • Input schema validation for the get_categories tool parameters: token, limit, country.
    schema: createSchema({ token: commonSchemas.token(), limit: commonSchemas.limit(1, 50, 20), country: commonSchemas.country(), }),
  • SpotifyService helper method that implements the actual API call to Spotify's browse/categories endpoint.
    async getCategories( token: string, limit: number = 20, country: string | null = null ): Promise<{ categories: PagingObject<SpotifyCategory> }> { const params: Record<string, any> = { limit: Math.min(limit, 50) }; if (country) params.country = country; return await this.makeRequest<{ categories: PagingObject<SpotifyCategory>; }>("browse/categories", token, params); }

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/latiftplgu/Spotify-OAuth-MCP-server'

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