Skip to main content
Glama

playlist_create

Create a new playlist for mpv media player by specifying a name and an array of absolute file paths or URLs. Organize media files for playback through natural language commands.

Instructions

Create a new playlist with a list of file paths.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesPlaylist name
filesYesArray of absolute file paths or URLs

Implementation Reference

  • Tool schema definition for playlist_create, declaring name, description, and inputSchema with required string 'name' and string array 'files'.
      name: "playlist_create",
      description: "Create a new playlist with a list of file paths.",
      inputSchema: {
        type: "object",
        properties: {
          name: { type: "string", description: "Playlist name" },
          files: {
            type: "array",
            items: { type: "string" },
            description: "Array of absolute file paths or URLs",
          },
        },
        required: ["name", "files"],
      },
    },
  • Handler for playlist_create: validates files non-empty, calls writePlaylist helper to write .m3u file, returns success with playlist path.
    case "playlist_create": {
      if (!args.files || args.files.length === 0)
        return fail("files array cannot be empty");
      writePlaylist(args.name, args.files);
      return ok(
        `Created playlist "${args.name}" with ${args.files.length} item(s)\nSaved to: ${playlistPath(args.name)}`
      );
    }
  • index.js:726-729 (registration)
    MCP registration: the CallToolRequestSchema handler dispatches tool name (including 'playlist_create') to handleTool().
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
      const { name, arguments: args } = request.params;
      return handleTool(name, args || {});
    });
  • Helper function writePlaylist: writes an M3U playlist file to the playlists directory with #EXTM3U header and each file path on its own line.
    function writePlaylist(name, files) {
      const content = "#EXTM3U\n" + files.join("\n") + "\n";
      fs.writeFileSync(playlistPath(name), content, "utf8");
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are present, so the description carries the full burden. It fails to disclose important behaviors such as whether an existing playlist with the same name is replaced, whether files must exist on disk, or if paths/URLs are validated. The brief statement does not cover safety or side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with no waste. However, it could be slightly more structured to include key constraints without becoming verbose. Still, it earns points for brevity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of output schema and annotations, the description should provide more context about return values, error conditions, or the behavior when a playlist name already exists. The current description is too minimal for a creation tool with two required parameters.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, and the schema already documents both parameters (name and files) with clear descriptions. The description adds little new meaning beyond restating 'list of file paths', which is less precise than the schema's 'absolute file paths or URLs'.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Create a new playlist') and the input source ('list of file paths'). The verb 'create' distinguishes it from sibling tools like playlist_add (which implies adding to existing) and playlist_load (loading a saved playlist).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance is provided on when to use this tool versus alternatives. The description does not mention scenarios like creating a new playlist from scratch vs. adding to an existing one, nor does it reference sibling tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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

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