itunes_current_song
Retrieve the currently playing track details including song name, artist, and album from Apple Music on macOS.
Instructions
Get information about the currently playing track. Returns the track name, artist, and album.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- mcp_applemusic.py:122-138 (handler)The handler function for the 'itunes_current_song' tool. It uses AppleScript via run_applescript to query the Music app for the currently playing track's name, artist, and album.@mcp.tool() def itunes_current_song() -> str: """ Get information about the currently playing track. Returns the track name, artist, and album. """ script = """ tell application "Music" if player state is playing then set currentTrack to current track return "Now playing: " & (name of currentTrack) & " by " & (artist of currentTrack) & " from " & (album of currentTrack) else return "No track is currently playing" end if end tell """ return run_applescript(script)