Skip to main content
Glama

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
NameRequiredDescriptionDefault
nameNoPlaylist name to inspect (omit to list all playlists)

Implementation Reference

  • 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")}`);
  • 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", ""));
    }

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/guodaxia9527/mcp-mpv-player'

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