Skip to main content
Glama

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
NameRequiredDescriptionDefault
position_msYes

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

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