previous_track
Return to the previous song in your Spotify playback queue. Use this tool to navigate back through your listening history and replay tracks.
Instructions
Go back to previous track
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- main.py:50-53 (handler)MCP tool handler for 'previous_track', decorated with @mcp.tool() for automatic registration and FastMCP integration. Delegates execution to SpotifyClient.previous_track() method.@mcp.tool() async def previous_track() -> str: """Go back to previous track""" return await client.previous_track()
- spotify.py:170-178 (helper)Implementation of previous_track in SpotifyClient class, which invokes the spotipy library's previous_track method to control Spotify playback.async def previous_track(self) -> str: """ Skip to the previous track. """ try: self.sp.previous_track() return "Skipped to previous track" except Exception as e: return f"Error skipping track: {str(e)}"