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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- mcp_applemusic.py:107-119 (handler)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)