get_current_playing
Retrieve details about the track currently playing in Spotify, including song title, artist, and playback status.
Instructions
Get information about the currently playing track
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/playback.ts:38-60 (handler)The core handler function for the 'get_current_playing' tool. It retrieves the currently playing track using SpotifyClient and returns formatted information about the track or indicates if nothing is playing.export async function getCurrentPlaying(client: SpotifyClient) { const track = await client.getCurrentlyPlaying(); if (!track) { return { success: true, playing: false, message: 'No track currently playing', }; } return { success: true, playing: track.isPlaying, track: { name: track.name, artist: track.artist, album: track.album, uri: track.uri, progressMs: track.progressMs, }, }; }
- src/server.ts:300-309 (registration)Registration in the CallToolRequestSchema handler: dispatches the 'get_current_playing' tool call to the playbackTools.getCurrentPlaying function and formats the response.case 'get_current_playing': const currentResult = await playbackTools.getCurrentPlaying(client); return { content: [ { type: 'text', text: JSON.stringify(currentResult, null, 2), }, ], };
- src/server.ts:154-162 (schema)Tool schema definition in the ListToolsRequestSchema response, including name, description, and empty input schema (no parameters required).{ name: 'get_current_playing', description: 'Get information about the currently playing track', inputSchema: { type: 'object', properties: {}, }, }, {