Skip to main content
Glama
keenanbb

TIDAL MCP Server

by keenanbb

get_playlist_tracks

Retrieve track listings from TIDAL playlists by providing the playlist ID. This tool returns songs, artists, and album details for music organization and playback.

Instructions

Get tracks from a specific playlist.

Args: playlist_id: ID of the playlist limit: Maximum tracks to return (default: 100)

Returns: List of tracks in the playlist

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
playlist_idYes
limitNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
countYesNumber of tracks returned
statusYesOperation status (success/error)
tracksYesList of track objects
playlist_idYesID of the playlist
playlist_nameYesName of the playlist

Implementation Reference

  • Main handler function implementing the get_playlist_tracks tool logic using tidalapi to fetch playlist tracks.
    @mcp.tool()
    async def get_playlist_tracks(playlist_id: str, limit: int = 100) -> PlaylistTracks:
        """
        Get tracks from a specific playlist.
    
        Args:
            playlist_id: ID of the playlist
            limit: Maximum tracks to return (default: 100)
    
        Returns:
            List of tracks in the playlist
        """
        if not await ensure_authenticated():
            raise ToolError("Not authenticated. Please run the 'login' tool first.")
    
        try:
            playlist = await anyio.to_thread.run_sync(session.playlist, playlist_id)
            if not playlist:
                raise ToolError(f"Playlist with ID '{playlist_id}' not found")
    
            all_tracks = await anyio.to_thread.run_sync(playlist.tracks)
            limited_tracks = all_tracks[:limit] if limit else all_tracks
    
            tracks = []
            for track in limited_tracks:
                tracks.append(
                    Track(
                        id=str(track.id),
                        title=track.name,
                        artist=track.artist.name if track.artist else "Unknown Artist",
                        album=track.album.name if track.album else "Unknown Album",
                        duration_seconds=track.duration,
                        url=f"https://tidal.com/browse/track/{track.id}",
                    )
                )
    
            return PlaylistTracks(
                status="success",
                playlist_name=playlist.name,
                playlist_id=playlist_id,
                count=len(tracks),
                tracks=tracks,
            )
        except ToolError:
            raise
        except Exception as e:
            raise ToolError(f"Failed to get playlist tracks: {str(e)}")
  • Pydantic schema for the output of get_playlist_tracks, defining the structure of the response including playlist metadata and list of tracks.
    class PlaylistTracks(BaseModel):
        """Tracks from a specific playlist."""
    
        status: str = Field(description="Operation status (success/error)")
        playlist_name: str = Field(description="Name of the playlist")
        playlist_id: str = Field(description="ID of the playlist")
        count: int = Field(description="Number of tracks returned")
        tracks: List[Track] = Field(description="List of track objects")
  • Pydantic model for individual Track objects used within PlaylistTracks response.
    class Track(BaseModel):
        """Structured representation of a TIDAL track."""
    
        id: str = Field(description="Unique TIDAL track ID")
        title: str = Field(description="Track title")
        artist: str = Field(description="Primary artist name")
        album: str = Field(description="Album name")
        duration_seconds: int = Field(description="Track duration in seconds")
        url: str = Field(description="TIDAL web URL for the track")
  • Tool mentioned in server instructions/docstring for user guidance.
    - get_playlist_tracks: Get tracks from a playlist
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 returns a list of tracks but doesn't cover key aspects like whether it's read-only (implied by 'get'), pagination behavior, rate limits, authentication needs, or error handling. 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 core purpose, followed by structured sections for args and returns. Every sentence adds value, with no wasted words, though the structure is simple and 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's low complexity (2 parameters, no nested objects) and the presence of an output schema (which handles return values), the description is minimally adequate. However, with no annotations and 0% schema description coverage, it lacks behavioral context and usage guidance, making it incomplete for optimal agent operation.

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?

Schema description coverage is 0%, so the description must compensate. It adds meaning by explaining 'playlist_id' as 'ID of the playlist' and 'limit' as 'Maximum tracks to return (default: 100)', which clarifies the parameters beyond the bare schema. However, it doesn't detail format constraints (e.g., ID structure) or usage nuances, leaving some gaps.

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 as 'Get tracks from a specific playlist,' which is a specific verb+resource combination. However, it doesn't explicitly distinguish this tool from sibling tools like 'get_user_playlists' or 'search_playlists,' which might also return playlist-related data, so it doesn't reach the highest score.

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 sibling tools like 'get_user_playlists' for listing playlists or 'search_tracks' for broader track searches, leaving the agent to infer usage from the name 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/keenanbb/tidal-mcp'

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