Skip to main content
Glama
Cifero74

mcp-apple-music

get_playlist_tracks

Retrieve track listings from Apple Music playlists by providing a playlist ID, enabling users to view and manage their music library content.

Instructions

Get the tracks inside a specific playlist.

Args: playlist_id: Library playlist ID (starts with 'p.'). Use get_library_playlists to find IDs. limit: Maximum tracks to return, 1–100 (default 100).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
playlist_idYes
limitNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The implementation of the get_playlist_tracks tool handler, which fetches tracks from a specific Apple Music playlist using the library client.
    @mcp.tool()
    async def get_playlist_tracks(playlist_id: str, limit: int = 100) -> str:
        """Get the tracks inside a specific playlist.
    
        Args:
            playlist_id: Library playlist ID (starts with 'p.').
                         Use get_library_playlists to find IDs.
            limit: Maximum tracks to return, 1–100 (default 100).
        """
        client = _get_client()
        data = await client.get(
            f"/me/library/playlists/{playlist_id}/tracks",
            params={"limit": min(max(1, limit), 100)},
        )
        tracks = data.get("data", [])
    
        if not tracks:
            return f"No tracks found in playlist '{playlist_id}'."
    
        lines = [f"🎵 Tracks in playlist [{playlist_id}] — {len(tracks)} tracks:\n"]
        for i, t in enumerate(tracks, 1):
            a = t.get("attributes", {})
            lines.append(
                f"  {i}. {a.get('name', '?')} — {a.get('artistName', '?')}"
                f" | Type: {t.get('type', '?')} | ID: {t.get('id', '?')}"
            )
Behavior3/5

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

With no annotations provided, the description carries full disclosure burden. It provides operational constraints (limit range 1-100, default 100, ID format 'p.'), but lacks explicit safety confirmation (read-only nature), error behaviors, or pagination details for large playlists.

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?

Efficiently structured with clear purpose statement followed by Args block. No redundant information; every line provides specific value. Appropriate length for tool complexity.

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

Completeness5/5

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

Given presence of output schema, simple parameter structure (2 primitives), and clear behavioral anchors, the description is complete. Prerequisites, constraints, and sibling relationships are adequately covered.

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

Parameters5/5

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

Excellent compensation for 0% schema description coverage. Provides format pattern for playlist_id ('p.'), cross-reference for ID lookup, and complete constraint documentation for limit (valid range and default), adding substantial meaning beyond the bare schema.

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

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description uses specific verb 'Get' with clear resource 'tracks' and scope 'inside a specific playlist'. Clearly distinguishes from sibling get_library_playlists which retrieves playlists rather than tracks within them, and from add_tracks_to_playlist which modifies.

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

Usage Guidelines4/5

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

Provides clear prerequisite guidance by referencing sibling tool get_library_playlists to find valid IDs. However, lacks explicit 'when not to use' guidance compared to alternatives like get_library_songs or search_catalog.

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/Cifero74/mcp-apple-music'

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