play_pause
Play, pause, or toggle the current Spotify playback state. Choose the action via the optional parameter.
Instructions
Control Spotify playback – play, pause, or toggle the current state.
Parameters
action : str, optional
One of "play", "pause", or "toggle" (default).
Returns
dict
{"status": "playing" | "paused" | "no_active_device"}
Raises
ValueError
If action is not one of the accepted values.
spotipy.SpotifyException
Propagated if the Spotify API returns a non-2xx response.
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": "play_pause"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | No | toggle |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||