Skip to main content
Glama

get_recommendations

Generate personalized music recommendations using artist, track, or genre seeds to discover new songs on Spotify.

Instructions

Get Spotify recommendations based on seeds
Args:
    seed_artists: Comma-separated artist IDs
    seed_tracks: Comma-separated track IDs
    seed_genres: Comma-separated genres
    limit: Number of recommendations

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
seed_artistsNo
seed_tracksNo
seed_genresNo
limitNo

Implementation Reference

  • main.py:72-87 (handler)
    The main handler function for the 'get_recommendations' MCP tool. Decorated with @mcp.tool() for automatic registration and schema inference. Delegates to SpotifyClient.recommendations.
    @mcp.tool()
    async def get_recommendations(
        seed_artists: str = None,
        seed_tracks: str = None,
        seed_genres: str = None,
        limit: int = 20,
    ) -> str:
        """
        Get Spotify recommendations based on seeds
        Args:
            seed_artists: Comma-separated artist IDs
            seed_tracks: Comma-separated track IDs
            seed_genres: Comma-separated genres
            limit: Number of recommendations
        """
        return await client.recommendations(seed_artists, seed_tracks, seed_genres, limit)
  • Helper method in SpotifyClient class that implements the core logic for fetching Spotify recommendations using the spotipy library.
    async def recommendations(
        self,
        seed_artists: Optional[str] = None,
        seed_tracks: Optional[str] = None,
        seed_genres: Optional[str] = None,
        limit: int = 20,
    ) -> dict:
        """
        Get recommendations based on seed artists, tracks, or genres.
        """
        try:
            recommendations = self.sp.recommendations(
                seed_artists=seed_artists,
                seed_tracks=seed_tracks,
                seed_genres=seed_genres,
                limit=limit,
            )
            return recommendations
        except Exception as e:
            return f"Error getting recommendations: {str(e)}"
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral context. It states it 'gets' recommendations (implied read-only) but doesn't disclose rate limits, authentication needs, response format, or what happens with invalid seeds. For a tool with 4 parameters and no annotation coverage, this leaves significant gaps in understanding how the tool behaves.

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

Conciseness5/5

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

The description is efficiently structured: a clear purpose sentence followed by a bullet-like list of parameter explanations. Every sentence earns its place, with no redundant or verbose language. It's appropriately sized for a tool with 4 straightforward parameters.

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

Completeness3/5

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

Given no annotations, no output schema, and 4 parameters, the description is minimally complete. It covers the purpose and parameter semantics adequately but lacks behavioral context (e.g., response format, error handling) and usage guidelines. For a recommendation tool that likely returns structured data, the absence of output details is a notable gap.

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?

The description adds meaningful semantics beyond the schema: it explains that seed_artists, seed_tracks, and seed_genres are 'comma-separated' IDs/genres, and clarifies that limit is the 'Number of recommendations'. With 0% schema description coverage, this compensates well by providing format and purpose for all parameters, though it doesn't specify constraints like valid genre names or limit ranges.

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: 'Get Spotify recommendations based on seeds' - a specific verb ('Get') and resource ('Spotify recommendations') with the key mechanism ('based on seeds'). It distinguishes from siblings like search_spotify (which searches) or get_top_artists (which retrieves user data). However, it doesn't explicitly contrast with all potential recommendation alternatives.

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. It doesn't mention prerequisites (e.g., needing seeds), when-not scenarios (e.g., if you want user-specific recommendations), or name specific sibling tools as alternatives. The agent must infer usage from the purpose alone.

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