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)}"
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool searches Spotify, implying a read-only operation, but doesn't cover critical aspects like authentication requirements, rate limits, error handling, or the format of search results. For a search tool with zero annotation coverage, this lack of behavioral details is a significant gap, leaving the agent uncertain about execution risks and outcomes.

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 appropriately sized and front-loaded, starting with the core purpose in the first sentence. The parameter explanations are listed concisely without unnecessary elaboration. However, the structure could be slightly improved by integrating the parameter details more seamlessly or adding a brief usage example, but overall, it's efficient with minimal waste.

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

Completeness2/5

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

Given the complexity of a search tool with 3 parameters, no annotations, and no output schema, the description is incomplete. It lacks information on authentication, rate limits, result format, pagination, or error cases. While it covers the basic purpose and parameters, it doesn't provide enough context for the agent to use the tool effectively in real-world scenarios, especially without structured output details.

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

Parameters3/5

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

The description adds some parameter semantics beyond the input schema, which has 0% schema description coverage. It explains that 'query' is a 'Search term', 'type' is 'One of 'track', 'artist', 'album', 'playlist'', and 'limit' is 'Max number of results'. This clarifies the purpose of each parameter, compensating partially for the schema's lack of descriptions. However, it doesn't provide examples, constraints (e.g., limit ranges), or default behavior details, keeping the score at a baseline level.

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

Purpose4/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 Spotify for tracks, artists, albums, or playlists.' This specifies the verb (search) and resource (Spotify content), making it distinct from siblings like 'get_current_track' or 'get_my_playlists'. However, it doesn't explicitly differentiate from 'get_recommendations', which might also involve searching, though the latter is more about generating suggestions rather than direct query-based search.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. For example, it doesn't mention when to choose 'search_spotify' over 'get_recommendations' for finding content, or how it differs from 'get_item_info' for retrieving specific items. Without such context, the agent must infer usage based on tool names alone, which is insufficient for optimal selection.

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

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