Skip to main content
Glama

set_default_device

Set the default Spotify device ID for playback operations to ensure music plays on your preferred speaker or device.

Instructions

Set the default Spotify device ID to use for all playback operations

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
deviceIdYesDevice ID to set as default

Implementation Reference

  • Handler for the 'set_default_device' tool: validates the deviceId argument, calls deviceManager.setDefaultDevice(deviceId), and returns a success or error response.
    case 'set_default_device': const deviceId = args?.deviceId as string; if (!deviceId) { return { content: [ { type: 'text', text: JSON.stringify({ success: false, error: 'deviceId is required', }, null, 2), }, ], isError: true, }; } deviceManager.setDefaultDevice(deviceId); return { content: [ { type: 'text', text: JSON.stringify({ success: true, message: `Default device set to: ${deviceId}`, deviceId, }, null, 2), }, ], };
  • Input schema definition for the 'set_default_device' tool, requiring a 'deviceId' string, as part of the tool registration in listTools response.
    { name: 'set_default_device', description: 'Set the default Spotify device ID to use for all playback operations', inputSchema: { type: 'object', properties: { deviceId: { type: 'string', description: 'Device ID to set as default', }, }, required: ['deviceId'], }, },
  • Implementation of setDefaultDevice method in DeviceManager class, which stores the provided deviceId as the default.
    setDefaultDevice(deviceId: string) { this.defaultDeviceId = 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/Ackberry/spotify_mcp'

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