Skip to main content
Glama
leehave
by leehave

list_playlists

Retrieve all available playlists from the Claude Music MCP server to view and manage your music collections.

Instructions

列出所有播放列表

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that implements the core logic of the 'list_playlists' tool. It fetches all playlists using PlaylistManager and formats a response listing their names, descriptions, song counts, and IDs.
    private async handleListPlaylists(args: any) { const playlists = await this.playlistManager.getAllPlaylists(); return { content: [ { type: 'text', text: `📋 所有播放列表:\n\n${playlists.map(playlist => `🎵 ${playlist.name}\n📝 ${playlist.description || '无描述'}\n🎶 ${playlist.songIds.length} 首歌曲\n🆔 ID: ${playlist.id}\n` ).join('\n')}`, }, ], }; }
  • src/index.ts:129-136 (registration)
    Registration of the 'list_playlists' tool in the ListTools response, including its name, description, and empty input schema.
    { name: 'list_playlists', description: '列出所有播放列表', inputSchema: { type: 'object', properties: {}, }, },
  • src/index.ts:179-180 (registration)
    Dispatcher case in the CallToolRequest handler that routes 'list_playlists' calls to the specific handler function.
    case 'list_playlists': return await this.handleListPlaylists(args);
  • Input schema definition for the 'list_playlists' tool, which requires no parameters.
    inputSchema: { type: 'object', properties: {}, },
  • Supporting method in PlaylistManager that retrieves all playlists, used by the tool handler.
    async getAllPlaylists(): Promise<Playlist[]> { return Array.from(this.playlists.values()); }

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