Skip to main content
Glama

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
NameRequiredDescriptionDefault

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()
  • 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)}"

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/ashwanth1109/mcp-spotify'

If you have feedback or need assistance with the MCP directory API, please join our Discord server