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
| Name | Required | Description | Default |
|---|---|---|---|
| deviceId | Yes | Device ID to set as default |
Implementation Reference
- src/server.ts:417-446 (handler)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), }, ], };
- src/server.ts:221-234 (schema)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'], }, },
- src/device-manager.ts:10-12 (helper)Implementation of setDefaultDevice method in DeviceManager class, which stores the provided deviceId as the default.setDefaultDevice(deviceId: string) { this.defaultDeviceId = deviceId; }