Skip to main content
Glama
marcelmarais

Spotify MCP Server

by marcelmarais

createPlaylist

Create a new playlist on Spotify with a custom name, description, and privacy settings using the Spotify MCP Server.

Instructions

Create a new playlist on Spotify

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesThe name of the playlist
descriptionNoThe description of the playlist
publicNoWhether the playlist should be public

Implementation Reference

  • The complete tool definition for 'createPlaylist', including its Zod schema and async handler function that creates a new Spotify playlist using the spotifyApi.
    const createPlaylist: tool<{
      name: z.ZodString;
      description: z.ZodOptional<z.ZodString>;
      public: z.ZodOptional<z.ZodBoolean>;
    }> = {
      name: 'createPlaylist',
      description: 'Create a new playlist on Spotify',
      schema: {
        name: z.string().describe('The name of the playlist'),
        description: z
          .string()
          .optional()
          .describe('The description of the playlist'),
        public: z
          .boolean()
          .optional()
          .describe('Whether the playlist should be public'),
      },
      handler: async (args, _extra: SpotifyHandlerExtra) => {
        const { name, description, public: isPublic = false } = args;
    
        const result = await handleSpotifyRequest(async (spotifyApi) => {
          const me = await spotifyApi.currentUser.profile();
    
          return await spotifyApi.playlists.createPlaylist(me.id, {
            name,
            description,
            public: isPublic,
          });
        });
    
        return {
          content: [
            {
              type: 'text',
              text: `Successfully created playlist "${name}"\nPlaylist ID: ${result.id}\nPlaylist URL: ${result.external_urls.spotify}`,
            },
          ],
        };
      },
    };
  • src/play.ts:499-510 (registration)
    The 'createPlaylist' tool is included in the exported 'playTools' array, which collects Spotify playback-related tools.
    export const playTools = [
      playMusic,
      pausePlayback,
      skipToNext,
      skipToPrevious,
      createPlaylist,
      addTracksToPlaylist,
      resumePlayback,
      addToQueue,
      setVolume,
      adjustVolume,
    ];
  • src/index.ts:12-14 (registration)
    Tools from 'playTools' (including 'createPlaylist') are registered on the MCP server by calling server.tool() for each tool in the array.
    [...readTools, ...playTools, ...albumTools].forEach((tool) => {
      server.tool(tool.name, tool.description, tool.schema, tool.handler);
    });
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. While 'Create' implies a write operation, it doesn't mention authentication requirements, rate limits, what happens on failure, or whether this creates playlists for the current user or another user. The description is minimal and lacks important behavioral context.

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 states exactly what the tool does without any wasted words. It's appropriately sized for a simple creation tool and gets straight to the point.

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?

For a creation tool with no annotations and no output schema, the description is insufficient. It doesn't explain what happens after creation (does it return the new playlist ID?), what authentication is needed, or potential error conditions. Given the complexity of a write operation to an external service, more context 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 has 100% description coverage, so all parameters are documented in the schema itself. The description doesn't add any additional meaning about the parameters beyond what's already in the schema descriptions. This meets the baseline expectation when schema coverage is high.

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 on Spotify'), making the purpose immediately understandable. However, it doesn't differentiate this tool from potential sibling tools like 'getMyPlaylists' or 'addTracksToPlaylist' beyond the obvious creation vs. retrieval distinction.

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 about when to use this tool versus alternatives. There's no mention of prerequisites (like authentication), when not to use it, or how it relates to sibling tools like 'addTracksToPlaylist' or 'getMyPlaylists'.

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/marcelmarais/spotify-mcp-server'

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