Skip to main content
Glama

itunes_next

Skip to the next track in Apple Music playback using MCP commands for macOS control.

Instructions

Skip to the next track.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'itunes_next' tool, registered via @mcp.tool(). It executes an AppleScript command to skip to the next track in the Music (iTunes) application using the run_applescript helper.
    @mcp.tool() def itunes_next() -> str: """Skip to the next track.""" script = 'tell application "Music" to next track' return run_applescript(script)
  • Shared helper function that executes AppleScript via osascript subprocess, used by the itunes_next handler and other tools to interact with the Music application.
    def run_applescript(script: str) -> str: """Execute an AppleScript command via osascript and return its output.""" result = subprocess.run(["osascript", "-e", script], capture_output=True, text=True) if result.returncode != 0: return f"Error: {result.stderr.strip()}" return result.stdout.strip()

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