Skip to main content
Glama
TaylorChen

Multi-MCPs

by TaylorChen

add_tracks_to_playlist

Add songs to a Spotify playlist using track URIs. This tool enables users to expand their music collections by inserting multiple tracks into existing playlists through the Multi-MCPs server.

Instructions

Add tracks to a playlist by URIs

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
playlist_idYes
tracksYes

Implementation Reference

  • The main handler function for the 'add_tracks_to_playlist' tool. It validates inputs and delegates to the SpotifyClient's addTracksToPlaylist method.
    async add_tracks_to_playlist(args: Record<string, unknown>) {
      if (!cfg.spotifyClientId || !cfg.spotifyClientSecret) throw new Error("SPOTIFY_CLIENT_ID/SECRET are not configured");
      const playlistId = String(args.playlist_id || "");
      const tracks = Array.isArray(args.tracks) ? (args.tracks as string[]) : [];
      if (!playlistId || tracks.length === 0) throw new Error("playlist_id and tracks are required");
      return client.addTracksToPlaylist(playlistId, tracks);
    },
  • Input schema definition for the tool, specifying playlist_id as string and tracks as array of strings.
    inputSchema: {
      type: "object",
      properties: { playlist_id: { type: "string" }, tracks: { type: "array", items: { type: "string" } } },
      required: ["playlist_id", "tracks"],
    },
  • Tool registration object defining name, description, and schema, returned as part of registerSpotify().
    {
      name: "add_tracks_to_playlist",
      description: "Add tracks to a playlist by URIs",
      inputSchema: {
        type: "object",
        properties: { playlist_id: { type: "string" }, tracks: { type: "array", items: { type: "string" } } },
        required: ["playlist_id", "tracks"],
      },
    },
  • Helper method in SpotifyClient class that makes the actual Spotify API request to add tracks to a playlist.
    async addTracksToPlaylist(playlistId: string, tracks: string[]) {
      return this.request(`/playlists/${playlistId}/tracks`, {
        method: "POST",
        headers: await this.authHeaders(),
        body: { uris: tracks },
      });
    }
  • Invocation of registerSpotify() in the central registerAllTools function, integrating the Spotify tools into the MCP server.
    registerSpotify(),
Behavior2/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 states the action is 'Add tracks,' implying a mutation, but doesn't cover permissions needed, rate limits, whether duplicates are allowed, or what happens on success/failure. For a write operation with zero annotation coverage, this leaves significant gaps in understanding tool behavior.

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 with zero waste—'Add tracks to a playlist by URIs'—front-loading the core action and method. Every word earns its place, making it highly concise and well-structured for quick understanding.

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 2 parameters), lack of annotations, and no output schema, the description is incomplete. It doesn't address behavioral aspects like side effects, error handling, or return values, leaving the agent with inadequate context for reliable use.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate for undocumented parameters. It mentions 'URIs' for tracks, adding some meaning to the 'tracks' array parameter, but doesn't explain 'playlist_id' format or source. With 2 parameters and low coverage, this partial clarification is insufficient, scoring below the baseline of 3.

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 ('Add tracks') and target resource ('to a playlist'), with the method specified ('by URIs'). It distinguishes from sibling tools like 'create_playlist' (which creates playlists) and 'search_tracks' (which finds tracks). However, it doesn't explicitly differentiate from potential overlapping tools like 'update_playlist' if that existed, keeping it at 4 rather than 5.

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., needing an existing playlist), exclusions (e.g., not for removing tracks), or compare to siblings like 'create_playlist' for initial setup. Usage is implied by the action but lacks explicit context.

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/TaylorChen/muti-mcps'

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