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);
    }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It adds useful context about what the tool returns (complete list of categories with names, descriptions, icons, etc.) and mentions requirements (valid Spotify access token, categories reflect current organization). However, it doesn't address important behavioral aspects like rate limits, error conditions, pagination (despite having a 'limit' parameter), or whether this is a read-only operation (though implied by 'get' name).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is excessively long and repetitive with multiple sections (USE CASES, WHAT IT RETURNS, EXAMPLES, CATEGORY TYPES, ORGANIZATION BENEFITS, USE IN APPLICATIONS, REQUIREMENTS) that contain overlapping information. Many sentences don't earn their place, such as the redundant 'Perfect for building browsing interfaces' and 'Helps users navigate vast music catalogs'. The core information could be conveyed in 3-4 concise sentences rather than this verbose structure.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 3-parameter tool with no annotations and no output schema, the description provides substantial context about what the tool does and returns. However, it lacks critical information about the output format structure, error handling, and behavioral constraints. The description compensates somewhat for the missing output schema by detailing return content, but doesn't specify the actual data structure or format.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 67% schema description coverage (2 of 3 parameters have descriptions), the description doesn't explicitly mention any parameters but provides contextual information that helps understand their purpose. The mention of 'Country code for localized content' in the schema aligns with the description's focus on Spotify's organization. The 'limit' parameter (with no schema description) is somewhat addressed by the description's emphasis on returning 'Complete list' and 'all music categories', though pagination behavior isn't clarified.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verbs ('Explore all available music categories') and resources ('Spotify uses to organize and classify playlists and content'). It distinguishes from sibling tools by focusing on categories rather than tracks, playlists, artists, or playback functions. The description explicitly mentions what the tool does in the opening sentence.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context through extensive use cases (e.g., 'Build category-based music browsing interfaces', 'Discover music genres and style classifications') and application examples ('Create category-based navigation menus', 'Build genre-specific recommendation engines'). However, it doesn't explicitly state when NOT to use this tool or name specific alternatives among the sibling tools for different purposes.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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