Skip to main content
Glama

get_current_playing

Retrieve details about the currently playing Spotify track, including title, artist, and playback status.

Instructions

Get information about the currently playing track

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function that fetches the currently playing track using SpotifyClient.getCurrentlyPlaying() and returns formatted track info or no-playing status.
    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:170-177 (registration)
    Tool registration entry in the ListToolsRequestSchema handler, defining the tool name, description, and empty input schema.
    { name: 'get_current_playing', description: 'Get information about the currently playing track', inputSchema: { type: 'object', properties: {}, }, },
  • MCP server dispatch in CallToolRequestSchema switch statement that calls the getCurrentPlaying handler and formats the response as MCP content.
    case 'get_current_playing': const currentResult = await playbackTools.getCurrentPlaying(client); return { content: [ { type: 'text', text: JSON.stringify(currentResult, null, 2), }, ], };
  • Input schema definition for the tool (empty object, no parameters required).
    inputSchema: { type: 'object', properties: {}, },
  • Import of playbackTools module containing the getCurrentPlaying function.
    import * as playbackTools from './tools/playback.js';

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