list_playlists
Retrieve all available playlists on Claude Music MCP to manage and organize your music collection. Ideal for accessing and reviewing your saved playlists quickly.
Instructions
列出所有播放列表
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:286-299 (handler)The main handler function for the 'list_playlists' tool. It retrieves all playlists using the PlaylistManager and formats a response listing them with details like name, description, song count, and ID.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 (schema)The input schema and metadata for the 'list_playlists' tool defined in the ListToolsRequestHandler response.{ name: 'list_playlists', description: '列出所有播放列表', inputSchema: { type: 'object', properties: {}, }, },
- src/index.ts:179-180 (registration)The switch case that registers and dispatches 'list_playlists' tool calls to the handler.case 'list_playlists': return await this.handleListPlaylists(args);
- src/playlist-manager.ts:35-37 (helper)Supporting method in PlaylistManager that provides the list of all playlists used by the tool handler.async getAllPlaylists(): Promise<Playlist[]> { return Array.from(this.playlists.values()); }