analyze-now-playing.ts•918 B
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
export function registerAnalyzeNowPlayingPrompt(server: McpServer) {
server.registerPrompt(
"analyze_now_playing",
{
title: "Analyze Current Track",
description: "Analyze what's currently playing and get recommendations for similar music"
},
async () => {
const promptText = `Please analyze what I'm currently listening to on Spotify:
1. Use get_playback_state to see what's playing now
2. Search for the artist to get more context about their music
3. Use get_recommendations with the current track as a seed
4. Suggest 5-7 similar tracks I might enjoy and explain why they're good matches`;
return {
messages: [
{
role: "user",
content: {
type: "text",
text: promptText,
},
},
],
};
}
);
}