Skip to main content
Glama
leehave
by leehave

get_playlist

Retrieve detailed information about a specific playlist using its unique ID. Part of Claude Music MCP for managing, searching, and organizing music playlists efficiently.

Instructions

获取播放列表信息

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
playlistIdYes播放列表ID

Implementation Reference

  • Primary handler for 'get_playlist' tool: extracts playlistId, fetches playlist and songs, formats response.
    private async handleGetPlaylist(args: any) { const { playlistId } = args; const playlist = await this.playlistManager.getPlaylist(playlistId); if (!playlist) { throw new Error(`未找到ID为 ${playlistId} 的播放列表`); } const songs = await Promise.all( playlist.songIds.map(id => this.musicDb.getSongById(id)) ); return { content: [ { type: 'text', text: `🎵 播放列表: ${playlist.name}\n\n描述: ${playlist.description || '无'}\n歌曲数量: ${playlist.songIds.length}\n创建时间: ${playlist.createdAt}\n\n歌曲列表:\n${songs.map((song, index) => `${index + 1}. ${song?.title} - ${song?.artist}` ).join('\n')}`, }, ], }; }
  • src/index.ts:116-128 (registration)
    Tool registration defining name, description, and input schema for 'get_playlist'.
    name: 'get_playlist', description: '获取播放列表信息', inputSchema: { type: 'object', properties: { playlistId: { type: 'string', description: '播放列表ID', }, }, required: ['playlistId'], }, },
  • TypeScript interface defining the Playlist data structure used by the tool.
    export interface Playlist { id: string; name: string; description?: string; songIds: string[]; createdAt: string; updatedAt: string; }
  • Core helper method in PlaylistManager that retrieves a playlist by ID from in-memory storage.
    async getPlaylist(id: string): Promise<Playlist | undefined> { return this.playlists.get(id); }

Other Tools

Related Tools

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/leehave/Claude-Music-Mcp'

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