Skip to main content
Glama

create-playlist

Generate a personalized Spotify playlist by specifying a name, optional description, and public or private visibility. Save and organize your favorite tracks with ease.

Instructions

Create a new playlist for the current user

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
descriptionNoDescription of the playlist (optional)
nameYesName of the playlist
publicNoWhether the playlist should be public (default: false)

Implementation Reference

  • Handler for the 'create-playlist' tool: parses arguments using CreatePlaylistSchema, fetches user ID, creates a new playlist via Spotify API POST request to /users/{userId}/playlists, and returns the playlist details.
          if (name === "create-playlist") {
            const { name, description, public: isPublic } = CreatePlaylistSchema.parse(args);
            
            const userInfo = await spotifyApiRequest("/me");
            const userId = userInfo.id;
            
            const playlist = await spotifyApiRequest(
              `/users/${userId}/playlists`,
              "POST",
              {
                name,
                description,
                public: isPublic,
              }
            );
            
            return {
              content: [
                {
                  type: "text",
                  text: `Playlist created successfully:
    Name: ${playlist.name}
    ID: ${playlist.id}
    URL: ${playlist.external_urls.spotify}`,
                },
              ],
            };
          }
  • Zod schema for validating input parameters of the create-playlist tool: requires 'name', optional 'description' and 'public' (defaults to false). Used in both registration inputSchema and handler parsing.
    const CreatePlaylistSchema = z.object({
      name: z.string(),
      description: z.string().optional(),
      public: z.boolean().default(false),
    });
  • index.ts:729-750 (registration)
    Tool registration in the ListTools response: defines name, description, and inputSchema matching the CreatePlaylistSchema.
    {
      name: "create-playlist",
      description: "Create a new playlist for the current user",
      inputSchema: {
        type: "object",
        properties: {
          name: {
            type: "string",
            description: "Name of the playlist",
          },
          description: {
            type: "string",
            description: "Description of the playlist (optional)",
          },
          public: {
            type: "boolean",
            description: "Whether the playlist should be public (default: false)",
          },
        },
        required: ["name"],
      },
    },
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states it creates a playlist but doesn't cover critical aspects like authentication requirements, rate limits, whether it returns the created playlist ID, or error conditions. This leaves significant gaps for an agent to understand how to invoke it safely and effectively.

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 that directly states the tool's purpose without unnecessary words. It's front-loaded with the core action and resource, making it easy to parse quickly.

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 tool's complexity (a write operation with no annotations and no output schema), the description is insufficient. It doesn't explain what happens after creation (e.g., returns a playlist ID), authentication needs, or how it fits into workflows with sibling tools. For a mutation tool in this context, more completeness is needed.

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 schema description coverage is 100%, with clear descriptions for all parameters (name, description, public). The description adds no additional parameter semantics beyond what's in the schema, such as explaining format constraints or default behaviors. Baseline 3 is appropriate since the schema adequately documents 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 ('Create') and resource ('new playlist for the current user'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'get-user-playlists' or 'add-tracks-to-playlist', which would require mentioning this is specifically for creation rather than retrieval or modification.

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 via 'auth-spotify'), when not to use it (e.g., for updating existing playlists), or how it relates to siblings like 'add-tracks-to-playlist' for populating playlists after creation.

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

Related 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/imprvhub/mcp-claude-spotify'

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