Skip to main content
Glama

itunes_library

Get a summary of your Apple Music library, including total tracks and user playlists, to manage your music collection effectively.

Instructions

Return a summary of the Music library, including total tracks and user playlists.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'itunes_library' tool. It uses an AppleScript script executed via the shared 'run_applescript' helper to query the Music application's library for total tracks and playlists, returning a summary string.
    @mcp.tool()
    def itunes_library() -> str:
        """
        Return a summary of the Music library, including total tracks and user playlists.
        """
        script = """
        tell application "Music"
            set totalTracks to count of every track of playlist "Library"
            set totalPlaylists to count of user playlists
            return "Total tracks: " & totalTracks & linefeed & "Total playlists: " & totalPlaylists
        end tell
        """
        return run_applescript(script)

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/kennethreitz/mcp-applemusic'

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