Skip to main content
Glama
Cifero74

mcp-apple-music

add_tracks_to_playlist

Add songs from your library or Apple Music catalog to an existing playlist using track IDs and playlist ID.

Instructions

Add tracks to an existing playlist.

Args: playlist_id: The target playlist ID (starts with 'p.'). track_ids: List of track IDs to add. track_type: 'library-songs' for tracks from your library (default), 'songs' for catalog tracks found via search_catalog.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
playlist_idYes
track_idsYes
track_typeNolibrary-songs

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The `add_tracks_to_playlist` function handles the request to add tracks to a specific Apple Music playlist by communicating with the client API.
    async def add_tracks_to_playlist(
        playlist_id: str,
        track_ids: list[str],
        track_type: str = "library-songs",
    ) -> str:
        """Add tracks to an existing playlist.
    
        Args:
            playlist_id: The target playlist ID (starts with 'p.').
            track_ids: List of track IDs to add.
            track_type: 'library-songs' for tracks from your library (default),
                        'songs' for catalog tracks found via search_catalog.
        """
        if not track_ids:
            return "❌ No track IDs provided."
    
        client = _get_client()
        body = {"data": [{"id": tid, "type": track_type} for tid in track_ids]}
        await client.post(f"/me/library/playlists/{playlist_id}/tracks", body)
    
        return (
            f"✅ Added {len(track_ids)} track(s) to playlist [{playlist_id}].\n"
            f"   Track IDs: {', '.join(track_ids)}"
        )
Behavior2/5

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

No annotations are provided, so the description carries full disclosure burden. While 'Add' indicates a write operation, it lacks critical behavioral details such as duplicate handling (whether adding existing tracks creates duplicates), idempotency, or partial failure behavior.

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?

Uses an 'Args:' structure to document parameters, which is appropriate given the complete lack of schema descriptions. Information is front-loaded with the action summary, and every line provides necessary parameter constraints.

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?

Adequately documents inputs given the output schema exists, covering parameter formats and valid values. However, for a mutation tool with no annotations, it should disclose edge case behaviors (e.g., duplicate handling) to be complete.

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?

Effectively compensates for 0% schema description coverage by adding the 'p.' format hint for playlist_id and detailed semantic explanations for track_type (distinguishing library-songs vs songs sourced from search_catalog).

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?

Clear verb (Add) and resource (tracks) with scope (to existing playlist). The word 'existing' implicitly distinguishes from the sibling create_playlist tool, though it does not explicitly name the alternative.

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

Usage Guidelines3/5

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

Provides parameter-level guidance by referencing sibling tool search_catalog for the 'songs' track_type value. However, lacks tool-level guidance on when to use this versus create_playlist or prerequisites like playlist ownership.

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