Skip to main content
Glama
Cifero74

mcp-apple-music

get_library_artists

Retrieve a list of artists from your Apple Music library with pagination controls to manage large collections.

Instructions

List artists in your Apple Music library.

Args: limit: Number of artists to return, 1–100 (default 25). offset: Pagination offset (default 0).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
offsetNo

Implementation Reference

  • The implementation of the get_library_artists tool handler, which fetches artists from the Apple Music library using the client and formats the response.
    @mcp.tool()
    async def get_library_artists(limit: int = 25, offset: int = 0) -> str:
        """List artists in your Apple Music library.
    
        Args:
            limit: Number of artists to return, 1–100 (default 25).
            offset: Pagination offset (default 0).
        """
        client = _get_client()
        data = await client.get(
            "/me/library/artists",
            params={"limit": min(max(1, limit), 100), "offset": max(0, offset)},
        )
        artists = data.get("data", [])
    
        if not artists:
            return "No artists found in your library."
    
        lines = ["👤 Library Artists:\n"]
        for i, a in enumerate(artists, offset + 1):
            lines.append(_fmt_artist(a, 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