seek_position
Jump to a specific timestamp in the currently playing Spotify track by specifying the position in milliseconds.
Instructions
Seek to position in current track
Args:
position_ms: Position in milliseconds
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| position_ms | Yes |
Implementation Reference
- main.py:56-63 (handler)The main handler function for the 'seek_position' tool, decorated with @mcp.tool() which registers it and defines the input schema from the signature. It delegates to SpotifyClient.seek_track(position_ms).@mcp.tool() async def seek_position(position_ms: int) -> str: """ Seek to position in current track Args: position_ms: Position in milliseconds """ return await client.seek_track(position_ms)
- spotify.py:180-189 (helper)Supporting helper method in SpotifyClient class that performs the actual Spotify API seek operation using the spotipy client (self.sp.seek_track). This is invoked by the tool handler.async def seek_track(self, position_ms: int) -> str: """ Seek to position in currently playing track. - position_ms: Position in milliseconds """ try: self.sp.seek_track(position_ms=position_ms) return f"Seeked to position {position_ms}ms" except Exception as e: return f"Error seeking: {str(e)}"