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); }

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