Skip to main content
Glama

search_albums

Search Spotify's music catalog to find albums by artist, title, keywords, genre, or release year. Get detailed results including artwork, track counts, and popularity metrics.

Instructions

Search for albums using flexible keywords, artist names, or album titles to discover music.

🎯 USE CASES: • Finding albums when you only remember partial information • Discovering discographies of new artists • Searching for concept albums or themed collections • Finding albums by genre, mood, or era • Locating rare releases, deluxe editions, or remastered versions

📝 WHAT IT RETURNS: • Ranked search results based on relevance • Album names, artists, and release years • Album artwork and Spotify popularity metrics • Genre information and track counts • External URLs and availability information

🔍 EXAMPLES: • "Search for albums by 'Pink Floyd'" • "Find albums with 'greatest hits' in the title" • "Search for 'jazz piano' albums" • "Look for albums containing 'live' or 'concert'" • "Find albums released in '1969'"

💡 SEARCH TIPS: • Use quotes for exact phrase matching: "Abbey Road" • Combine artist and album names: "Beatles White Album" • Use genre keywords: "progressive rock", "indie folk" • Include year ranges: "1970s rock albums" • Try alternate spellings or abbreviations

⚠️ REQUIREMENTS: • Valid Spotify access token • Search query with meaningful keywords

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tokenYesSpotify access token for authentication
queryYesSearch query for albums (album name, artist, keywords)
limitNo

Implementation Reference

  • Handler function for the 'search_albums' tool. It extracts arguments (token, query, limit) and delegates to SpotifyService.searchAlbums.
    handler: async (args: any, spotifyService: SpotifyService) => {
      const { token, query, limit = 20 } = args;
      return await spotifyService.searchAlbums(token, query, limit);
    },
  • Input schema definition for the 'search_albums' tool using createSchema, defining token, query, and optional limit parameters.
    schema: createSchema({
      token: commonSchemas.token(),
      query: commonSchemas.searchQuery("albums (album name, artist, keywords)"),
      limit: commonSchemas.limit(1, 50, 20),
    }),
  • Complete tool definition and registration of 'search_albums' within the albumTools object, including title, description, schema, and handler.
      search_albums: {
        title: "Search Albums",
        description: `Search for albums using flexible keywords, artist names, or album titles to discover music.
    
    🎯 USE CASES:
    • Finding albums when you only remember partial information
    • Discovering discographies of new artists
    • Searching for concept albums or themed collections
    • Finding albums by genre, mood, or era
    • Locating rare releases, deluxe editions, or remastered versions
    
    📝 WHAT IT RETURNS:
    • Ranked search results based on relevance
    • Album names, artists, and release years
    • Album artwork and Spotify popularity metrics
    • Genre information and track counts
    • External URLs and availability information
    
    🔍 EXAMPLES:
    • "Search for albums by 'Pink Floyd'"
    • "Find albums with 'greatest hits' in the title"
    • "Search for 'jazz piano' albums"
    • "Look for albums containing 'live' or 'concert'"
    • "Find albums released in '1969'"
    
    💡 SEARCH TIPS:
    • Use quotes for exact phrase matching: "Abbey Road"
    • Combine artist and album names: "Beatles White Album"
    • Use genre keywords: "progressive rock", "indie folk"
    • Include year ranges: "1970s rock albums"
    • Try alternate spellings or abbreviations
    
    ⚠️ REQUIREMENTS:
    • Valid Spotify access token
    • Search query with meaningful keywords`,
        schema: createSchema({
          token: commonSchemas.token(),
          query: commonSchemas.searchQuery("albums (album name, artist, keywords)"),
          limit: commonSchemas.limit(1, 50, 20),
        }),
        handler: async (args: any, spotifyService: SpotifyService) => {
          const { token, query, limit = 20 } = args;
          return await spotifyService.searchAlbums(token, query, limit);
        },
      },
  • SpotifyService method that performs the actual album search by calling Spotify's /search API endpoint with type='album'.
    async searchAlbums(
      token: string,
      query: string,
      limit: number = 20
    ): Promise<SearchResult> {
      const params = {
        q: query,
        type: "album",
        limit: Math.min(limit, 50),
      };
      return await this.makeRequest<SearchResult>("search", token, params);
    }
Behavior5/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 what the tool returns (e.g., 'Ranked search results based on relevance', 'Album artwork and Spotify popularity metrics'), requirements ('Valid Spotify access token'), and search behavior ('Use quotes for exact phrase matching', 'Combine artist and album names'). This covers key operational aspects beyond basic functionality.

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

Conciseness4/5

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

The description is well-structured with clear sections (USE CASES, WHAT IT RETURNS, EXAMPLES, etc.), making it easy to scan. However, it is lengthy with multiple bullet points, which, while informative, could be more concise. Every sentence earns its place by adding value, but some redundancy exists (e.g., examples reiterate use cases).

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

Completeness5/5

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

Given the tool's complexity (search functionality with 3 parameters), no annotations, and no output schema, the description is highly complete. It covers purpose, usage, behavioral details, parameter context, and output information comprehensively. The lack of output schema is mitigated by the 'WHAT IT RETURNS' section, ensuring the agent understands the response format.

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

Parameters5/5

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

The schema description coverage is 67% (2 out of 3 parameters have descriptions), but the description compensates by adding significant value. It explains the 'query' parameter in detail through examples and search tips, clarifies the need for a 'token' in requirements, and implies usage of 'limit' through context like returning 'ranked search results'. This enhances understanding beyond the schema's minimal descriptions.

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: 'Search for albums using flexible keywords, artist names, or album titles to discover music.' It specifies the verb ('search'), resource ('albums'), and scope ('flexible keywords, artist names, or album titles'), distinguishing it from sibling tools like 'search_artists' or 'search_tracks' that target different resource types.

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

Usage Guidelines5/5

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

The description provides explicit usage guidance through sections like 'USE CASES' (e.g., 'Finding albums when you only remember partial information'), 'EXAMPLES' (e.g., 'Search for albums by 'Pink Floyd''), and 'SEARCH TIPS' (e.g., 'Use quotes for exact phrase matching'). It implicitly distinguishes from alternatives by focusing on album-specific search, unlike broader tools like 'search_music'.

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