Skip to main content
Glama
Cifero74

mcp-apple-music

get_library_songs

Retrieve songs from your Apple Music library with pagination controls to manage large collections efficiently.

Instructions

List songs saved in your Apple Music library.

Args: limit: Number of songs to return, 1–100 (default 25). offset: Pagination offset for retrieving subsequent pages (default 0).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
offsetNo

Implementation Reference

  • The handler function 'get_library_songs' implements the logic for fetching and returning library songs via the Apple Music API client.
    async def get_library_songs(limit: int = 25, offset: int = 0) -> str:
        """List songs saved in your Apple Music library.
    
        Args:
            limit: Number of songs to return, 1–100 (default 25).
            offset: Pagination offset for retrieving subsequent pages (default 0).
        """
        client = _get_client()
        data = await client.get(
            "/me/library/songs",
            params={"limit": min(max(1, limit), 100), "offset": max(0, offset)},
        )
        songs = data.get("data", [])
        total = data.get("meta", {}).get("total", "?")
    
        if not songs:
            return "No songs found in your library."
    
        lines = [f"🎵 Library Songs — showing {offset + 1}–{offset + len(songs)} of {total}:\n"]
        for i, s in enumerate(songs, offset + 1):
            lines.append(_fmt_song(s, i))
        return "\n".join(lines)
    
    
    # ------------------------------------------------------------------ #
    #  Tool: get_library_albums                                           #

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