Skip to main content
Glama

create_playlist

Create custom Spotify playlists for organizing music by mood, activity, or event. Specify name, description, and privacy settings to build collections for workouts, parties, study sessions, or collaborative listening.

Instructions

Create a new custom playlist in the user's Spotify library with specified name and settings.

🎯 USE CASES: • Build themed playlists for specific moods or activities • Create event-specific music collections for parties • Organize music discoveries into curated collections • Build workout, study, or relaxation playlists • Create collaborative playlists for groups and friends

📝 WHAT IT RETURNS: • New playlist information with unique Spotify ID • Playlist URL for easy sharing and access • Creation confirmation with metadata • Empty playlist ready for track additions • Settings confirmation (public/private, collaborative)

🔍 EXAMPLES: • "Create a playlist called 'Summer Vibes 2024'" • "Make a private playlist for my workout music" • "Create 'Study Sessions' playlist with description" • "Build a collaborative playlist for our road trip"

🎵 PLAYLIST CUSTOMIZATION: • Custom name and description for context • Public or private visibility settings • Collaborative options for group contributions • Ready for immediate track additions • Perfect foundation for curated collections

💡 CREATION STRATEGIES: • Use descriptive names for easy discovery • Add detailed descriptions for context • Consider privacy settings based on content • Plan collaborative access for group playlists • Create multiple themed playlists for organization

⚠️ REQUIREMENTS: • Valid Spotify access token with playlist-modify-public/private scopes • Unique playlist name (duplicates allowed but not recommended)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tokenYesSpotify access token for authentication
nameYesName for the new playlist
descriptionNo
isPublicNo

Implementation Reference

  • The handler function for the MCP 'create_playlist' tool. It parses arguments and delegates the playlist creation to the SpotifyService.
    handler: async (args: any, spotifyService: SpotifyService) => {
      const { token, name, description = "", isPublic = true } = args;
      return await spotifyService.createPlaylist(
        token,
        name,
        description,
        isPublic
      );
    },
  • Zod-based input schema for the 'create_playlist' tool, defining parameters: token, name, optional description, and optional isPublic.
    schema: createSchema({
      token: commonSchemas.token(),
      name: z.string().describe("Name for the new playlist"),
      description: z
        .string()
        .optional()
        .describe("Description for the playlist"),
      isPublic: z
        .boolean()
        .default(true)
        .describe("Whether the playlist should be public"),
    }),
  • The complete tool definition object for 'create_playlist' within the playlistTools registry, including title, description, schema, and handler.
      create_playlist: {
        title: "Create Playlist",
        description: `Create a new custom playlist in the user's Spotify library with specified name and settings.
    
    🎯 USE CASES:
    • Build themed playlists for specific moods or activities
    • Create event-specific music collections for parties
    • Organize music discoveries into curated collections
    • Build workout, study, or relaxation playlists
    • Create collaborative playlists for groups and friends
    
    📝 WHAT IT RETURNS:
    • New playlist information with unique Spotify ID
    • Playlist URL for easy sharing and access
    • Creation confirmation with metadata
    • Empty playlist ready for track additions
    • Settings confirmation (public/private, collaborative)
    
    🔍 EXAMPLES:
    • "Create a playlist called 'Summer Vibes 2024'"
    • "Make a private playlist for my workout music"
    • "Create 'Study Sessions' playlist with description"
    • "Build a collaborative playlist for our road trip"
    
    🎵 PLAYLIST CUSTOMIZATION:
    • Custom name and description for context
    • Public or private visibility settings
    • Collaborative options for group contributions
    • Ready for immediate track additions
    • Perfect foundation for curated collections
    
    💡 CREATION STRATEGIES:
    • Use descriptive names for easy discovery
    • Add detailed descriptions for context
    • Consider privacy settings based on content
    • Plan collaborative access for group playlists
    • Create multiple themed playlists for organization
    
    ⚠️ REQUIREMENTS:
    • Valid Spotify access token with playlist-modify-public/private scopes
    • Unique playlist name (duplicates allowed but not recommended)`,
        schema: createSchema({
          token: commonSchemas.token(),
          name: z.string().describe("Name for the new playlist"),
          description: z
            .string()
            .optional()
            .describe("Description for the playlist"),
          isPublic: z
            .boolean()
            .default(true)
            .describe("Whether the playlist should be public"),
        }),
        handler: async (args: any, spotifyService: SpotifyService) => {
          const { token, name, description = "", isPublic = true } = args;
          return await spotifyService.createPlaylist(
            token,
            name,
            description,
            isPublic
          );
        },
      },
  • SpotifyService.createPlaylist method that performs the actual API call to create a playlist for the authenticated user.
    async createPlaylist(
      token: string,
      name: string,
      description: string = "",
      isPublic: boolean = true
    ): Promise<SpotifyPlaylist> {
      const userProfile = await this.getUserProfile(token);
      const userId = userProfile.id;
    
      const data = {
        name,
        description,
        public: isPublic,
      };
      return await this.makeRequest<SpotifyPlaylist>(
        `users/${userId}/playlists`,
        token,
        {},
        "POST",
        data
      );
    }
Behavior4/5

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

With no annotations provided, the description carries full burden and does well. It discloses behavioral traits: authentication requirements (Spotify access token with specific scopes), what gets created (new playlist with unique ID, URL, metadata), that it returns an empty playlist ready for track additions, and privacy/collaborative settings. It doesn't mention rate limits or error conditions, preventing a perfect score.

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

Conciseness3/5

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

The description is well-structured with clear sections (USE CASES, WHAT IT RETURNS, EXAMPLES, etc.) but is overly verbose. Some sections like 'CREATION STRATEGIES' and 'PLAYLIST CUSTOMIZATION' contain redundant information. While front-loaded with the core purpose, it could be more concise by eliminating repetitive advice about playlist naming and settings.

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

Completeness4/5

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

Given no annotations, 50% schema coverage, and no output schema, the description provides substantial context: purpose, usage, returns, examples, customization, strategies, and requirements. It covers authentication, behavior, and output details well. However, it lacks explicit error handling information and doesn't fully document all parameters, preventing a perfect score.

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

Parameters4/5

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

Schema description coverage is only 50% (2 of 4 parameters have descriptions). The description compensates by explaining parameter semantics in multiple sections: 'PLAYLIST CUSTOMIZATION' mentions name, description, public/private settings; 'EXAMPLES' shows name usage; 'REQUIREMENTS' covers token authentication. However, it doesn't explicitly map all 4 parameters or explain the 'description' parameter's empty schema description.

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 tool creates a new custom playlist in the user's Spotify library with specified name and settings. It uses specific verbs ('create', 'build', 'organize') and distinguishes from siblings like 'add_to_playlist' (which modifies existing playlists) and 'get_user_playlists' (which retrieves playlists). The purpose is unambiguous and well-differentiated.

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

Usage Guidelines5/5

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

The description provides explicit guidance on when to use this tool through multiple sections: 'USE CASES' lists specific scenarios (themed playlists, event collections, collaborative playlists), 'CREATION STRATEGIES' offers tactical advice, and 'REQUIREMENTS' specifies prerequisites. It implicitly distinguishes from sibling tools by focusing on creation rather than modification or retrieval.

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/latiftplgu/Spotify-OAuth-MCP-server'

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