next
Skip to the next track on a specified or active Sonos device and retrieve its updated state, including volume, playback status, and track details, using the Sonos MCP Server.
Instructions
Skip to the next track on a Sonos device.
Args: name: The name of the device to skip the track on. If None, uses the current device.
Returns: Dict[str, Any]: The device's state after skipping to the next track, including name, volume, state, and track info.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "next"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No |
Implementation Reference
- server.py:185-197 (handler)The handler function for the 'next' MCP tool. It is decorated with @mcp.tool() which registers it, retrieves the Sonos device, calls device.next() to skip the track, and returns the updated device info.
@mcp.tool() def next(name: Optional[str] = None) -> Dict[str, Any]: """Skip to the next track on a Sonos device. Args: name: The name of the device to skip the track on. If None, uses the current device. Returns: Dict[str, Any]: The device's state after skipping to the next track, including name, volume, state, and track info. """ device = get_device(name) device.next() return get_info_from(device)