Skip to main content
Glama

get_devices

Retrieve all Spotify-connected devices for playback targeting and management. Shows available speakers, phones, TVs, and other devices with their current status and capabilities.

Instructions

Retrieve all available Spotify-connected devices for the user's account.

🎯 USE CASES: • Display device options for playback targeting • Build device management and control interfaces • Check which devices are currently online and available • Monitor device battery levels and connection status • Create smart home integrations with Spotify-enabled devices

📝 WHAT IT RETURNS: • Complete list of user's connected devices • Device names, types, and unique identifiers • Current active state and availability status • Volume levels and playback capabilities • Device restrictions and supported features

🔍 EXAMPLES: • "Show me all my Spotify devices" • "What devices can I play music on?" • "List my available speakers and phones" • "Which devices are currently online?"

🔧 DEVICE TYPES: • Computer (desktop/laptop applications) • Smartphone (mobile apps) • Speaker (smart speakers, soundbars) • TV (smart TVs, streaming devices) • Car (automotive systems) • Game Console (PlayStation, Xbox)

💡 DEVICE MANAGEMENT: • Shows real-time availability status • Indicates which device is currently active • Displays volume control capabilities • Shows device-specific restrictions • Perfect for building device selector UIs

⚠️ REQUIREMENTS: • Valid Spotify access token with user-read-playback-state scope • At least one Spotify-enabled device must be logged in

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tokenYesSpotify access token for authentication

Implementation Reference

  • The MCP tool handler for get_devices, extracting token and delegating to SpotifyService.getUserDevices
    handler: async (args: any, spotifyService: SpotifyService) => {
      const { token } = args;
      return await spotifyService.getUserDevices(token);
    },
  • Input schema definition for the get_devices tool, requiring a valid Spotify access token
    schema: createSchema({
      token: commonSchemas.token(),
    }),
  • Full registration of the get_devices tool within the playbackTools object, including title, description, schema, and handler
      get_devices: {
        title: "Get User Devices",
        description: `Retrieve all available Spotify-connected devices for the user's account.
    
    🎯 USE CASES:
    • Display device options for playback targeting
    • Build device management and control interfaces
    • Check which devices are currently online and available
    • Monitor device battery levels and connection status
    • Create smart home integrations with Spotify-enabled devices
    
    📝 WHAT IT RETURNS:
    • Complete list of user's connected devices
    • Device names, types, and unique identifiers
    • Current active state and availability status
    • Volume levels and playback capabilities
    • Device restrictions and supported features
    
    🔍 EXAMPLES:
    • "Show me all my Spotify devices"
    • "What devices can I play music on?"
    • "List my available speakers and phones"
    • "Which devices are currently online?"
    
    🔧 DEVICE TYPES:
    • Computer (desktop/laptop applications)
    • Smartphone (mobile apps)
    • Speaker (smart speakers, soundbars)
    • TV (smart TVs, streaming devices)
    • Car (automotive systems)
    • Game Console (PlayStation, Xbox)
    
    💡 DEVICE MANAGEMENT:
    • Shows real-time availability status
    • Indicates which device is currently active
    • Displays volume control capabilities
    • Shows device-specific restrictions
    • Perfect for building device selector UIs
    
    ⚠️ REQUIREMENTS:
    • Valid Spotify access token with user-read-playback-state scope
    • At least one Spotify-enabled device must be logged in`,
        schema: createSchema({
          token: commonSchemas.token(),
        }),
        handler: async (args: any, spotifyService: SpotifyService) => {
          const { token } = args;
          return await spotifyService.getUserDevices(token);
        },
      },
  • SpotifyService helper method implementing the core logic by calling Spotify API endpoint /me/player/devices
    async getUserDevices(token: string): Promise<{ devices: SpotifyDevice[] }> {
      return await this.makeRequest<{ devices: SpotifyDevice[] }>(
        "me/player/devices",
        token
      );
    }
  • TypeScript interface defining the structure of SpotifyDevice objects returned by the tool
    export interface SpotifyDevice {
      id: string;
      is_active: boolean;
      is_private_session: boolean;
      is_restricted: boolean;
      name: string;
      type: string;
      volume_percent: number | null;
    }
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 well by disclosing key behavioral traits: real-time availability status, active device indication, volume control capabilities, device restrictions, and authentication requirements. It doesn't mention rate limits or error conditions, keeping it from a perfect score.

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

Conciseness3/5

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

While well-structured with clear sections, the description is quite lengthy with multiple detailed bullet lists. Some information (like specific device types and extensive use cases) could be more concise. The core purpose is front-loaded, but subsequent sections contain some redundancy.

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

Completeness4/5

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

For a read-only tool with no output schema, the description provides excellent context about what the tool returns, use cases, and requirements. It covers authentication needs, return data structure, and practical applications. The main gap is lack of output format details, but otherwise quite complete.

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?

The input schema has 100% description coverage, clearly documenting the single 'token' parameter. The description adds no additional parameter information beyond what's in the schema, so it meets the baseline of 3 where 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 specific verb ('Retrieve') and resource ('all available Spotify-connected devices for the user's account'). It distinguishes itself from siblings like get_currently_playing or transfer_playback by focusing on device enumeration rather than playback control or content retrieval.

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

Usage Guidelines4/5

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

The description provides clear context through USE CASES and DEVICE MANAGEMENT sections, showing when this tool is appropriate (e.g., for device selection UIs, monitoring availability). However, it doesn't explicitly state when NOT to use it or name specific alternatives among sibling tools for similar purposes.

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