Skip to main content
Glama

resume_player

Resume Spotify playback exactly where it paused, on the same or a different device, maintaining queue order, shuffle, repeat, and volume settings. Requires a valid Spotify access token and an existing playback session.

Instructions

Resume paused playback or continue playing from where the user left off.

🎯 USE CASES: • Resume music after phone calls or interruptions • Continue playback when returning to apps or devices • Implement "play/pause" toggle functionality • Resume listening after switching between devices • Restore playback state in smart home automations

📝 WHAT IT RETURNS: • Confirmation of resumed playback • Current track and position information • Updated playback state showing active play • Device information where playback resumed • Remaining track duration and queue preview

🔍 EXAMPLES: • "Resume my music where I left off" • "Continue playing on my phone" • "Resume the playlist I was listening to" • "Start playing again on my smart speaker"

💡 SMART RESUME: • Picks up exactly where playback was paused • Maintains queue order and shuffle settings • Preserves repeat mode and volume level • Can resume on the same or different device

⚠️ REQUIREMENTS: • Valid Spotify access token with user-modify-playback-state scope • Previous playback session must exist to resume • Target device must be available and active

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contextUriNo
deviceIdNoSpotify device ID (optional, uses active device if not specified)
tokenYesSpotify access token for authentication
trackUrisNo

Implementation Reference

  • The handler function that executes the core logic of the 'resume_player' tool by calling the SpotifyService.resumePlayback method with destructured arguments.
    handler: async (args: any, spotifyService: SpotifyService) => { const { token, contextUri, trackUris, deviceId } = args; return await spotifyService.resumePlayback( token, contextUri, trackUris, deviceId ); },
  • The Zod input schema for the 'resume_player' tool, validating token, optional contextUri, trackUris array, and deviceId.
    schema: createSchema({ token: commonSchemas.token(), contextUri: z .string() .optional() .describe("Spotify context URI (album, playlist, artist) to play"), trackUris: z .array(z.string()) .optional() .describe("Array of track URIs to play"), deviceId: commonSchemas.deviceId(), }),
  • The complete tool registration object for 'resume_player' within the playbackTools export, including title, description, schema, and handler.
    resume_player: { title: "Resume Player", description: `Resume paused playback or continue playing from where the user left off. 🎯 USE CASES: • Resume music after phone calls or interruptions • Continue playback when returning to apps or devices • Implement "play/pause" toggle functionality • Resume listening after switching between devices • Restore playback state in smart home automations 📝 WHAT IT RETURNS: • Confirmation of resumed playback • Current track and position information • Updated playback state showing active play • Device information where playback resumed • Remaining track duration and queue preview 🔍 EXAMPLES: • "Resume my music where I left off" • "Continue playing on my phone" • "Resume the playlist I was listening to" • "Start playing again on my smart speaker" 💡 SMART RESUME: • Picks up exactly where playback was paused • Maintains queue order and shuffle settings • Preserves repeat mode and volume level • Can resume on the same or different device ⚠️ REQUIREMENTS: • Valid Spotify access token with user-modify-playback-state scope • Previous playback session must exist to resume • Target device must be available and active`, schema: createSchema({ token: commonSchemas.token(), contextUri: z .string() .optional() .describe("Spotify context URI (album, playlist, artist) to play"), trackUris: z .array(z.string()) .optional() .describe("Array of track URIs to play"), deviceId: commonSchemas.deviceId(), }), handler: async (args: any, spotifyService: SpotifyService) => { const { token, contextUri, trackUris, deviceId } = args; return await spotifyService.resumePlayback( token, contextUri, trackUris, deviceId ); }, },
  • Aggregation and registration of playbackTools (containing resume_player) into the central allTools registry used by ToolRegistrar for MCP tool exposure.
    export const allTools: ToolsRegistry = { ...albumTools, ...artistTools, ...trackTools, ...playlistTools, ...playbackTools, ...userTools, ...searchTools, };
  • Supporting method in SpotifyService.resumePlayback that forwards to playMusic, implementing the resume logic via Spotify API.
    async resumePlayback( token: string, contextUri: string | null = null, trackUris: string | string[] | null = null, deviceId: string | null = null ): Promise<void> { return await this.playMusic(token, trackUris, contextUri, deviceId); }

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/latiftplgu/Spotify-OAuth-MCP-server'

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