Skip to main content
Glama
jamiew

Spotify MCP Server

get_artist_info

Retrieve detailed Spotify artist information and top tracks by providing the artist's Spotify ID.

Instructions

Get detailed information about a Spotify artist.

Args:
    artist_id: Spotify artist ID
Returns:
    Dict with artist info and top tracks

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
artist_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Registers the get_artist_info tool with the FastMCP server using the @mcp.tool() decorator.
    @mcp.tool()
    @log_tool_execution
  • The main handler function that executes the tool logic: fetches artist details and top 10 tracks using Spotify API, structures output using Artist model.
    def get_artist_info(artist_id: str) -> dict[str, Any]:
        """Get detailed information about a Spotify artist.
    
        Args:
            artist_id: Spotify artist ID
        Returns:
            Dict with artist info and top tracks
        """
        try:
            logger.info(f"🎤 Getting artist info: {artist_id}")
            result = spotify_client.artist(artist_id)
            top_tracks = spotify_client.artist_top_tracks(artist_id)
    
            artist = Artist(
                name=result["name"],
                id=result["id"],
                genres=result.get("genres", []),
                popularity=result.get("popularity"),
                followers=result.get("followers", {}).get("total"),
            )
    
            tracks = [parse_track(track) for track in top_tracks.get("tracks", [])[:10]]
    
            return {
                "artist": artist.model_dump(),
                "top_tracks": [track.model_dump() for track in tracks],
            }
        except SpotifyException as e:
            raise convert_spotify_error(e) from e
  • Pydantic model used for validating and serializing artist information in the get_artist_info tool output.
    class Artist(BaseModel):
        """A Spotify artist."""
    
        name: str
        id: str
        genres: list[str] | None = None
        popularity: int | None = None
        followers: int | None = None
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions the tool returns 'detailed information' and 'top tracks', but doesn't specify authentication requirements, rate limits, error conditions, or what constitutes 'detailed information'. For a read operation with zero annotation coverage, this leaves significant behavioral gaps.

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 with clear sections (purpose, args, returns). The first sentence states the core purpose, followed by structured parameter and return information. No wasted sentences, though the formatting could be more polished.

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 the tool has an output schema (which handles return value documentation) and only 1 parameter, the description is minimally adequate. However, for a tool with no annotations and multiple sibling tools, it should provide more context about when to use it and what authentication/rate limits apply.

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?

With 0% schema description coverage and only 1 parameter, the description adds meaningful context by specifying 'artist_id: Spotify artist ID' - clarifying the format and source of the ID. This compensates well for the schema's lack of description, though it doesn't provide examples or validation rules.

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 with 'Get detailed information about a Spotify artist' - a specific verb ('Get') and resource ('Spotify artist'). It distinguishes from siblings like get_track_info or get_album_info by specifying artist focus. However, it doesn't explicitly differentiate from all siblings (e.g., search_tracks could also return artist info).

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 when to use get_artist_info versus search_tracks for finding artist information, or how it differs from get_album_info which might include artist details. No context about prerequisites or limitations is provided.

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

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