playlist_list
List all saved playlists or view the contents of a specific playlist in the mpv media player.
Instructions
List all saved playlists or show contents of a specific playlist.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Playlist name to inspect (omit to list all playlists) |
Implementation Reference
- index.js:687-695 (handler)The handler implementation for the playlist_list tool in the main switch block.
case "playlist_list": { if (args.name) { const files = readPlaylist(args.name); const lines = files.map((f, i) => ` ${i}. ${f}`); return info(`π Playlist "${args.name}" (${files.length} items):\n${lines.join("\n")}`); } const playlists = listPlaylists(); if (playlists.length === 0) return info("No playlists found. Use playlist_create to make one."); return info(`π Saved playlists (${PLAYLIST_DIR}):\n${playlists.map((p) => ` β’ ${p}`).join("\n")}`); - index.js:273-278 (helper)The helper function that lists playlists by reading the M3U files in the directory.
function listPlaylists() { return fs .readdirSync(PLAYLIST_DIR) .filter((f) => f.endsWith(".m3u")) .map((f) => f.replace(".m3u", "")); }