get_available_genres
Retrieve available music genres from Spotify to filter recommendations and discover new artists or tracks based on specific genre preferences.
Instructions
Get a list of available genres for recommendations
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/handlers/tracks.ts:57-59 (handler)The core implementation of the get_available_genres tool. This method in the TracksHandler class makes a request to the Spotify API endpoint '/recommendations/available-genre-seeds' to fetch available genres for recommendations.async getAvailableGenres() { return this.api.makeRequest('/recommendations/available-genre-seeds'); }
- src/index.ts:309-317 (registration)Registration of the 'get_available_genres' tool in the ListTools response. Defines the tool name, description, and input schema (no parameters required).{ name: 'get_available_genres', description: 'Get a list of available genres for recommendations', inputSchema: { type: 'object', properties: {}, required: [] }, },
- src/index.ts:312-316 (schema)Input schema definition for the get_available_genres tool, specifying an empty object with no required properties.inputSchema: { type: 'object', properties: {}, required: [] },
- src/index.ts:782-787 (helper)Dispatch logic in the main CallToolRequestHandler switch statement that invokes the TracksHandler's getAvailableGenres method and formats the response as JSON text.case 'get_available_genres': { const result = await this.tracksHandler.getAvailableGenres(); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }