Skip to main content
Glama

search_spotify

Search Spotify for tracks, artists, albums, or playlists using a query, content type, and result limit to find specific music content.

Instructions

Search Spotify for tracks, artists, albums, or playlists. Args: query: Search term type: One of 'track', 'artist', 'album', 'playlist' limit: Max number of results

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
typeNotrack
limitNo

Implementation Reference

  • main.py:32-41 (handler)
    MCP tool handler for 'search_spotify' that invokes SpotifyClient.search
    @mcp.tool() async def search_spotify(query: str, type: str = "track", limit: int = 20) -> str: """ Search Spotify for tracks, artists, albums, or playlists. Args: query: Search term type: One of 'track', 'artist', 'album', 'playlist' limit: Max number of results """ return await client.search(query, type, limit)
  • SpotifyClient.search method implementing the core search logic using spotipy library
    async def search(self, query: str, qtype: str = "track", limit: int = 20) -> dict: """ Search for tracks, artists, albums, or playlists. - query: Search query - qtype: Either "track", "artist", "album", or "playlist" - limit: Max number of results (default 20) """ try: results = self.sp.search(q=query, type=qtype, limit=limit) return results except Exception as e: return f"Error searching: {str(e)}"

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/ashwanth1109/mcp-spotify'

If you have feedback or need assistance with the MCP directory API, please join our Discord server