itunes_library
Generate a summary of your Apple Music library, including total tracks and user playlists, for easy management and organization on macOS via MCP commands.
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 runs an AppleScript via run_applescript to query the Music app for the total number of tracks in the Library playlist and the total number of user playlists, returning a formatted 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)