Skip to main content
Glama

resume_player

Resume paused Spotify playback from where you left off, continuing music after interruptions or when switching devices.

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
tokenYesSpotify access token for authentication
contextUriNo
trackUrisNo
deviceIdNoSpotify device ID (optional, uses active device if not specified)

Implementation Reference

  • The main handler function for the 'resume_player' MCP tool. It extracts arguments and calls SpotifyService.resumePlayback to resume playback.
    handler: async (args: any, spotifyService: SpotifyService) => {
      const { token, contextUri, trackUris, deviceId } = args;
      return await spotifyService.resumePlayback(
        token,
        contextUri,
        trackUris,
        deviceId
      );
    },
  • Zod schema definition for input validation of the 'resume_player' tool.
    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 'resume_player' tool is registered by including playbackTools (which contains it) in the allTools registry used by ToolRegistrar for MCP server.
    export const allTools: ToolsRegistry = {
      ...albumTools,
    
      ...artistTools,
    
      ...trackTools,
    
      ...playlistTools,
    
      ...playbackTools,
    
      ...userTools,
    
      ...searchTools,
    };
  • Helper method in SpotifyService.resumePlayback, which delegates to playMusic for the actual API call.
    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);
    }
  • Core helper method playMusic that makes the Spotify API PUT request to /me/player/play to resume or start playback.
    async playMusic(
      token: string,
      trackUris: string | string[] | null = null,
      contextUri: string | null = null,
      deviceId: string | null = null
    ): Promise<void> {
      const data: Record<string, any> = {};
    
      if (trackUris) {
        data.uris = Array.isArray(trackUris)
          ? trackUris
          : [`spotify:track:${this.extractId(trackUris)}`];
      }
    
      if (contextUri) {
        data.context_uri = contextUri;
      }
    
      const endpoint = deviceId
        ? `me/player/play?device_id=${deviceId}`
        : "me/player/play";
    
      return await this.makeRequest<void>(endpoint, token, {}, "PUT", data);
    }
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description fully discloses behavioral traits: it explains what the tool does (resumes from paused state), what it returns (confirmation, track info), smart features (maintains settings, device flexibility), and requirements (token scope, session existence, device availability), covering mutation, authentication, and constraints.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with sections (USE CASES, WHAT IT RETURNS, etc.), but it is somewhat lengthy; every sentence adds value (e.g., clarifying returns, examples, requirements), though it could be more front-loaded by placing key behavioral info earlier.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (resuming playback with device handling), no annotations, 50% schema coverage, and no output schema, the description is highly complete: it covers purpose, usage, behavior, returns, examples, smart features, and requirements, providing all necessary context for an agent to invoke it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 50% (only 'token' and 'deviceId' have descriptions), but the description compensates by explaining parameter roles implicitly: it mentions 'target device' aligning with 'deviceId', and the 'SMART RESUME' section implies how 'contextUri' and 'trackUris' might be used to maintain queue settings, adding context beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verbs ('resume paused playback', 'continue playing') and distinguishes it from siblings like 'pause_player', 'start_playback', and 'search_and_play_music' by focusing on resuming existing sessions rather than starting new ones or pausing.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The 'USE CASES' section provides explicit scenarios for when to use this tool (e.g., after interruptions, returning to apps), and the 'REQUIREMENTS' section specifies prerequisites (e.g., valid token, existing playback session), clearly differentiating it from alternatives like 'start_playback' which initiates new playback.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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