Skip to main content
Glama
leehave

Claude Music MCP

by leehave

create_playlist

Create custom music playlists by specifying a name and optional description to organize your favorite tracks within the Claude Music MCP server.

Instructions

创建新的播放列表

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes播放列表名称
descriptionNo播放列表描述

Implementation Reference

  • The primary handler function for the 'create_playlist' tool. It destructures the input arguments, delegates playlist creation to PlaylistManager, and formats a success response with the new playlist details.
    private async handleCreatePlaylist(args: any) {
      const { name, description } = args;
      const playlist = await this.playlistManager.createPlaylist(name, description);
      
      return {
        content: [
          {
            type: 'text',
            text: `✅ 播放列表创建成功!\n\n名称: ${playlist.name}\n描述: ${playlist.description || '无'}\nID: ${playlist.id}\n创建时间: ${playlist.createdAt}`,
          },
        ],
      };
    }
  • Input schema definition for the 'create_playlist' tool, specifying required 'name' (string) and optional 'description' (string).
    inputSchema: {
      type: 'object',
      properties: {
        name: {
          type: 'string',
          description: '播放列表名称',
        },
        description: {
          type: 'string',
          description: '播放列表描述',
        },
      },
      required: ['name'],
    },
  • src/index.ts:79-96 (registration)
    Tool registration in the ListTools response, defining name, description, and input schema for 'create_playlist'.
    {
      name: 'create_playlist',
      description: '创建新的播放列表',
      inputSchema: {
        type: 'object',
        properties: {
          name: {
            type: 'string',
            description: '播放列表名称',
          },
          description: {
            type: 'string',
            description: '播放列表描述',
          },
        },
        required: ['name'],
      },
    },
  • src/index.ts:173-174 (registration)
    Dispatch registration in the CallToolRequest handler switch statement, routing 'create_playlist' calls to the handler method.
    case 'create_playlist':
      return await this.handleCreatePlaylist(args);
  • Supporting helper method in PlaylistManager that generates a unique ID, creates a new Playlist instance, stores it in memory, and returns it.
    async createPlaylist(name: string, description?: string): Promise<Playlist> {
      const id = this.nextId.toString();
      this.nextId++;
    
      const playlist: Playlist = {
        id,
        name,
        description,
        songIds: [],
        createdAt: new Date().toISOString(),
        updatedAt: new Date().toISOString(),
      };
    
      this.playlists.set(id, playlist);
      return playlist;
    }
Behavior1/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It only states the basic action ('create new playlist') without any details on permissions required, whether the operation is idempotent, what happens on failure, or the expected response format. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

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

Conciseness5/5

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

The description is a single, efficient sentence in Chinese that directly states the tool's purpose without unnecessary words. It is appropriately sized and front-loaded, making it easy for an agent to parse quickly. Every part of the sentence earns its place by conveying the core action and resource.

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 complexity of a creation tool with no annotations and no output schema, the description is incomplete. It lacks details on behavioral traits (e.g., side effects, error handling), usage context, and what the tool returns. While the schema covers parameters well, the overall context for safe and effective use is insufficient.

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?

The description adds no parameter information beyond what the schema provides. However, schema description coverage is 100%, with clear descriptions for both parameters ('name' and 'description'), so the baseline score of 3 is appropriate. The description doesn't compensate but doesn't need to, as the schema adequately documents the parameters.

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

Purpose4/5

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

The description clearly states the action ('创建新的' meaning 'create new') and resource ('播放列表' meaning 'playlist'), making the purpose immediately understandable. It distinguishes from siblings like 'add_to_playlist' or 'list_playlists' by focusing on creation rather than modification or retrieval. However, it doesn't specify the scope or context (e.g., for a user account or service), which prevents a perfect score.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., authentication), when not to use it (e.g., for updating existing playlists), or refer to sibling tools like 'add_to_playlist' for post-creation actions. This lack of context leaves the agent to infer usage from the tool name alone.

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/leehave/Claude-Music-Mcp'

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