Skip to main content
Glama

get_top_artists

Retrieve your most listened-to Spotify artists over customizable time periods to analyze listening habits and discover music preferences.

Instructions

Analyze your personal listening habits to discover your most played artists over different time periods.

🎯 USE CASES: • Understanding your personal music taste evolution • Creating "Year in Music" summaries and statistics • Building playlists based on your actual listening habits • Sharing your music taste with friends and social media • Discovering patterns in your music preferences

📝 WHAT IT RETURNS: • Your most listened-to artists ranked by play time • Artist names, images, and genre breakdowns • Listening statistics and time-period comparisons • Popularity scores and follower information • Insights into your musical preferences

🔍 EXAMPLES: • "Who are my top artists this month?" • "Show my most played artists of all time" • "Get my top 10 artists from the last 6 months" • "What artists have I been listening to most recently?"

⏰ TIME RANGES: • 'short_term' - Last 4 weeks of listening • 'medium_term' - Last 6 months of listening
• 'long_term' - All-time listening history • Compare across different periods for insights

⚠️ REQUIREMENTS: • Valid Spotify access token with user-top-read scope • Sufficient listening history for accurate results

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tokenYesSpotify access token for authentication
timeRangeNomedium_term
limitNo

Implementation Reference

  • The core handler function that executes the tool logic by making an authenticated API request to Spotify's 'me/top/artists' endpoint to retrieve the user's top artists over the specified time range.
    async getTopArtists(
      token: string,
      timeRange: "short_term" | "medium_term" | "long_term" = "medium_term",
      limit: number = 20
    ): Promise<TopItemsResponse<SpotifyArtist>> {
      const params = {
        time_range: timeRange,
        limit: Math.min(limit, 50),
      };
      return await this.makeRequest<TopItemsResponse<SpotifyArtist>>(
        "me/top/artists",
        token,
        params
      );
    }
  • Defines the input schema for the 'get_top_artists' tool, validating token, timeRange (short_term|medium_term|long_term), and limit parameters.
    schema: createSchema({
      token: commonSchemas.token(),
      timeRange: commonSchemas.timeRange(),
      limit: commonSchemas.limit(1, 50, 20),
    }),
  • Registers the 'get_top_artists' MCP tool with title, detailed description, schema, and wrapper handler that delegates to the SpotifyService.getTopArtists method.
      get_top_artists: {
        title: "Get User's Top Artists",
        description: `Analyze your personal listening habits to discover your most played artists over different time periods.
    
    🎯 USE CASES:
    • Understanding your personal music taste evolution
    • Creating "Year in Music" summaries and statistics
    • Building playlists based on your actual listening habits
    • Sharing your music taste with friends and social media
    • Discovering patterns in your music preferences
    
    📝 WHAT IT RETURNS:
    • Your most listened-to artists ranked by play time
    • Artist names, images, and genre breakdowns
    • Listening statistics and time-period comparisons
    • Popularity scores and follower information
    • Insights into your musical preferences
    
    🔍 EXAMPLES:
    • "Who are my top artists this month?"
    • "Show my most played artists of all time"
    • "Get my top 10 artists from the last 6 months"
    • "What artists have I been listening to most recently?"
    
    ⏰ TIME RANGES:
    • 'short_term' - Last 4 weeks of listening
    • 'medium_term' - Last 6 months of listening  
    • 'long_term' - All-time listening history
    • Compare across different periods for insights
    
    ⚠️ REQUIREMENTS:
    • Valid Spotify access token with user-top-read scope
    • Sufficient listening history for accurate results`,
        schema: createSchema({
          token: commonSchemas.token(),
          timeRange: commonSchemas.timeRange(),
          limit: commonSchemas.limit(1, 50, 20),
        }),
        handler: async (args: any, spotifyService: SpotifyService) => {
          const { token, timeRange = "medium_term", limit = 20 } = args;
          return await spotifyService.getTopArtists(token, timeRange, limit);
        },
      },
Behavior4/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 effectively describes key behavioral traits: it requires authentication ('Valid Spotify access token with user-top-read scope'), depends on user data ('Sufficient listening history for accurate results'), and provides insights into return values (e.g., 'Artist names, images, and genre breakdowns', 'Listening statistics'). It does not mention rate limits or error handling, but covers essential operational context.

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

Conciseness3/5

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

The description is well-structured with sections (USE CASES, WHAT IT RETURNS, etc.), but it is verbose with some redundancy (e.g., examples reiterate use cases). Sentences like 'Analyze your personal listening habits to discover your most played artists over different time periods' are front-loaded and clear, but the overall length could be trimmed without losing essential information.

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

Completeness4/5

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

Given the tool's moderate complexity (3 parameters, no output schema, no annotations), the description is largely complete. It covers purpose, usage, parameters, returns, and requirements adequately. However, without an output schema, it could provide more detail on the exact structure of return values (e.g., JSON format), though the 'WHAT IT RETURNS' section gives a good overview.

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?

Schema description coverage is low (33%), with only the 'token' parameter documented in the schema. The description compensates by explaining 'timeRange' options ('short_term', 'medium_term', 'long_term') and their meanings in the 'TIME RANGES' section, and implies 'limit' usage through examples like 'Get my top 10 artists'. It adds meaningful context beyond the schema, though it could explicitly define 'limit' semantics.

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: 'Analyze your personal listening habits to discover your most played artists over different time periods.' It specifies the verb ('analyze', 'discover'), resource ('personal listening habits', 'most played artists'), and scope ('over different time periods'), distinguishing it from siblings like get_artist, get_top_tracks, and get_recently_played by focusing on aggregated personal listening data.

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 for when to use this tool through 'USE CASES' (e.g., 'Understanding your personal music taste evolution', 'Creating Year in Music summaries') and 'EXAMPLES' (e.g., 'Who are my top artists this month?'). It implicitly distinguishes from siblings by focusing on personal top artists rather than general artist info or other listening data. However, it does not explicitly state when not to use it or name specific alternatives among siblings.

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