Skip to main content
Glama
Cifero74

mcp-apple-music

get_library_playlists

Retrieve all playlists from your Apple Music library. Specify a limit to control the number of playlists returned.

Instructions

List all playlists in your Apple Music library.

Args: limit: Maximum number of playlists to return, 1–100 (default 100).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo

Implementation Reference

  • The 'get_library_playlists' function is defined as an MCP tool, fetches playlists from the Apple Music API, and formats them for display.
    @mcp.tool()
    async def get_library_playlists(limit: int = 100) -> str:
        """List all playlists in your Apple Music library.
    
        Args:
            limit: Maximum number of playlists to return, 1–100 (default 100).
        """
        client = _get_client()
        data = await client.get(
            "/me/library/playlists",
            params={"limit": min(max(1, limit), 100)},
        )
        playlists = data.get("data", [])
    
        if not playlists:
            return "No playlists found in your library."
    
        lines = [f"📋 Your Playlists ({len(playlists)} found):\n"]
        for i, p in enumerate(playlists, 1):
            lines.append(_fmt_playlist(p, i))
        return "\n".join(lines)

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