Skip to main content
Glama

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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: [] }, },
  • Input schema definition for the get_available_genres tool, specifying an empty object with no required properties.
    inputSchema: { type: 'object', properties: {}, required: [] },
  • 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) }] }; }

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