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.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No |
Input Schema (JSON Schema)
{
"properties": {
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Name"
}
},
"title": "nextArguments",
"type": "object"
}
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)