Skip to main content
Glama
keenanbb

TIDAL MCP Server

by keenanbb

get_album

Retrieve detailed album information from TIDAL, including title, artist, release date, and track count by providing the album ID.

Instructions

Get detailed information about an album.

Args: album_id: ID of the album

Returns: Album details including title, artist, release date, and track count

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
album_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
albumYesAlbum information
statusYesOperation status (success/error)

Implementation Reference

  • The handler function for the 'get_album' tool. It checks authentication, fetches the album using tidalapi session.album, extracts details, constructs an AlbumDetails object, and returns it. Registered via @mcp.tool() decorator.
    @mcp.tool()
    async def get_album(album_id: str) -> AlbumDetails:
        """
        Get detailed information about an album.
    
        Args:
            album_id: ID of the album
    
        Returns:
            Album details including title, artist, release date, and track count
        """
        if not await ensure_authenticated():
            raise ToolError("Not authenticated. Please run the 'login' tool first.")
    
        try:
            album = await anyio.to_thread.run_sync(session.album, album_id)
            if not album:
                raise ToolError(f"Album with ID '{album_id}' not found")
    
            release_date = None
            if hasattr(album, "release_date") and album.release_date:
                release_date = str(album.release_date)
    
            return AlbumDetails(
                status="success",
                album=Album(
                    id=str(album.id),
                    title=album.name,
                    artist=album.artist.name if album.artist else "Unknown Artist",
                    release_date=release_date,
                    num_tracks=getattr(album, "num_tracks", 0),
                    duration_seconds=getattr(album, "duration", 0),
                    url=f"https://tidal.com/browse/album/{album.id}",
                ),
            )
        except ToolError:
            raise
        except Exception as e:
            raise ToolError(f"Failed to get album: {str(e)}")
  • Pydantic model defining the output schema for the get_album tool response.
    class AlbumDetails(BaseModel):
        """Detailed album information."""
    
        status: str = Field(description="Operation status (success/error)")
        album: Album = Field(description="Album information")
  • Pydantic model used within AlbumDetails for the structured album data in get_album response.
    class Album(BaseModel):
        """Structured representation of a TIDAL album."""
    
        id: str = Field(description="Unique TIDAL album ID")
        title: str = Field(description="Album title")
        artist: str = Field(description="Primary artist name")
        release_date: Optional[str] = Field(None, description="Release date (YYYY-MM-DD)")
        num_tracks: int = Field(description="Number of tracks in album")
        duration_seconds: int = Field(description="Total album duration in seconds")
        url: str = Field(description="TIDAL web URL for the album")
  • Helper function used by get_album to ensure the user is authenticated before fetching album data.
    async def ensure_authenticated() -> bool:
        """
        Check if user is authenticated with TIDAL.
        Automatically loads persisted session if available.
        """
        if await anyio.Path(SESSION_FILE).exists():
            try:
                async with await anyio.open_file(SESSION_FILE, "r") as f:
                    content = await f.read()
                    data = json.loads(content)
    
                # Load OAuth session
                result = await anyio.to_thread.run_sync(
                    session.load_oauth_session,
                    data["token_type"]["data"],
                    data["access_token"]["data"],
                    data["refresh_token"]["data"],
                    None,  # expiry time
                )
    
                if result:
                    is_valid = await anyio.to_thread.run_sync(session.check_login)
                    if not is_valid:
                        await anyio.Path(SESSION_FILE).unlink()
                    return is_valid
                return False
            except Exception:
                await anyio.Path(SESSION_FILE).unlink()
                return False
    
        return await anyio.to_thread.run_sync(session.check_login)
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 mentions that the tool 'Get detailed information' but does not specify if it's read-only, requires authentication, has rate limits, or what happens on errors. This is a significant gap for a tool with no annotation coverage.

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 with the main purpose, followed by structured Args and Returns sections. However, the Args section could be more integrated into the flow, and some sentences are redundant (e.g., repeating 'album' in the Args).

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

Completeness4/5

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

Given the tool's low complexity (1 parameter), no annotations, and the presence of an output schema (which handles return values), the description is mostly complete. It covers the purpose and basic parameter, but lacks behavioral details and usage guidelines, which are minor gaps in this context.

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 minimal semantics beyond the input schema, which has 0% description coverage. It states 'album_id: ID of the album,' providing basic meaning but no details on format, constraints, or examples. With low schema coverage, this is inadequate compensation, but it meets the baseline for having some param info.

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 an album,' specifying the verb (get) and resource (album). However, it does not explicitly differentiate from sibling tools like get_album_tracks or search_albums, which reduces clarity in distinguishing use cases.

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 does not mention when to choose get_album over get_album_tracks (for track details) or search_albums (for finding albums), leaving the agent without context for selection among similar tools.

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/keenanbb/tidal-mcp'

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