Skip to main content
Glama

get_currently_playing

Retrieve real-time information about the currently playing track in a Spotify session, including artist, album, playback progress, and device status.

Instructions

Get real-time information about what's currently playing in the user's Spotify session.

🎯 USE CASES: • Display "Now Playing" information in applications • Track listening history and habits in real-time • Create social media posts about current music • Build music discovery features based on current listening • Monitor playback state for automation and smart home integration

📝 WHAT IT RETURNS: • Currently playing track with artist and album information • Playback progress (current position vs. total duration) • Playback state (playing, paused, stopped) • Active device information and volume level • Shuffle and repeat mode settings • Track popularity and explicit content flags

🔍 EXAMPLES: • "What song is currently playing?" • "Show me my current playback status" • "Get the current track and how much time is left" • "What device am I listening on right now?"

💡 REAL-TIME FEATURES: • Updates instantly as tracks change • Shows exact playback position down to milliseconds • Indicates if user is actively listening or paused • Perfect for building live music widgets

⚠️ REQUIREMENTS: • Valid Spotify access token with user-read-playback-state scope • User must have an active Spotify session

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tokenYesSpotify access token for authentication

Implementation Reference

  • Registration of the 'get_currently_playing' MCP tool, defining its title, description, input schema (token), and handler that delegates to SpotifyService.getCurrentPlayback
      get_currently_playing: {
        title: "Get Currently Playing Track",
        description: `Get real-time information about what's currently playing in the user's Spotify session.
    
    🎯 USE CASES:
    • Display "Now Playing" information in applications
    • Track listening history and habits in real-time
    • Create social media posts about current music
    • Build music discovery features based on current listening
    • Monitor playback state for automation and smart home integration
    
    📝 WHAT IT RETURNS:
    • Currently playing track with artist and album information
    • Playback progress (current position vs. total duration)
    • Playback state (playing, paused, stopped)
    • Active device information and volume level
    • Shuffle and repeat mode settings
    • Track popularity and explicit content flags
    
    🔍 EXAMPLES:
    • "What song is currently playing?"
    • "Show me my current playback status"
    • "Get the current track and how much time is left"
    • "What device am I listening on right now?"
    
    💡 REAL-TIME FEATURES:
    • Updates instantly as tracks change
    • Shows exact playback position down to milliseconds
    • Indicates if user is actively listening or paused
    • Perfect for building live music widgets
    
    ⚠️ REQUIREMENTS:
    • Valid Spotify access token with user-read-playback-state scope
    • User must have an active Spotify session`,
        schema: createSchema({
          token: commonSchemas.token(),
        }),
        handler: async (args: any, spotifyService: SpotifyService) => {
          const { token } = args;
          return await spotifyService.getCurrentPlayback(token);
        },
      },
  • Handler function for the 'get_currently_playing' tool. Parses args for token and calls SpotifyService.getCurrentPlayback(token).
    handler: async (args: any, spotifyService: SpotifyService) => {
      const { token } = args;
      return await spotifyService.getCurrentPlayback(token);
    },
  • Input schema for the tool, requiring a Spotify access token.
    schema: createSchema({
      token: commonSchemas.token(),
    }),
  • Core implementation in SpotifyService: makes authenticated GET request to Spotify API endpoint '/me/player' to fetch current playback state.
    async getCurrentPlayback(token: string): Promise<CurrentPlayback | null> {
      return await this.makeRequest<CurrentPlayback | null>("me/player", token);
    }
  • TypeScript interface defining the structure of the current playback response from Spotify API.
    export interface CurrentPlayback {
      device: SpotifyDevice;
      repeat_state: "off" | "track" | "context";
      shuffle_state: boolean;
      context: {
        type: string;
        href: string;
        external_urls: { spotify: string };
        uri: string;
      } | null;
      timestamp: number;
      progress_ms: number | null;
      is_playing: boolean;
      item: SpotifyTrack | null;
      currently_playing_type: "track" | "episode" | "ad" | "unknown";
    }
Behavior4/5

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

With no annotations provided, the description carries full burden and does so well. It discloses real-time behavior ('Updates instantly as tracks change'), authentication needs ('Valid Spotify access token'), and specific constraints ('User must have an active Spotify session'). It doesn't mention rate limits or error handling, but covers key behavioral aspects thoroughly.

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 clear sections (USE CASES, WHAT IT RETURNS, EXAMPLES, etc.), but could be more concise. Some sections like 'REAL-TIME FEATURES' and 'EXAMPLES' contain slightly redundant information. Overall, it's front-loaded with the core purpose and each section adds value, though it could be trimmed slightly.

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 complexity of a real-time playback tool with no annotations and no output schema, the description provides excellent completeness. It explains what the tool returns in detail, includes use cases, examples, behavioral features, and requirements. This compensates well for the lack of structured output schema and annotations.

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

Parameters3/5

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

Schema description coverage is 100% (the 'token' parameter is fully described in the schema as 'Spotify access token for authentication'). The description adds no additional parameter information beyond what's in the schema, which is acceptable given the high schema coverage. Baseline 3 is appropriate when the schema does the heavy lifting.

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 a specific verb ('Get real-time information') and resource ('currently playing in the user's Spotify session'). It distinguishes from sibling tools like 'get_recently_played' or 'get_track' by focusing on real-time current playback rather than historical data or specific track lookups.

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 explicitly lists when to use this tool (e.g., 'Display "Now Playing" information', 'Track listening history in real-time'), and the 'REQUIREMENTS' section specifies prerequisites (valid token with user-read-playback-state scope, active session). This provides clear guidance on when to use versus alternatives like 'get_recently_played' for past data.

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