Skip to main content
Glama
marcelmarais

Spotify MCP Server

by marcelmarais

checkUsersSavedAlbums

Verify which Spotify albums are saved in your "Your Music" library by checking up to 20 album IDs at once.

Instructions

Check if albums are saved in the user's "Your Music" library

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
albumIdsYesArray of Spotify album IDs to check (max 20)

Implementation Reference

  • The handler function that implements the tool logic: validates input, calls Spotify API to check if albums are saved (spotifyApi.currentUser.albums.hasSavedAlbums), formats results as numbered list of album IDs with saved status.
      handler: async (args, _extra: SpotifyHandlerExtra) => {
        const { albumIds } = args;
    
        if (albumIds.length === 0) {
          return {
            content: [
              {
                type: 'text',
                text: 'Error: No album IDs provided',
              },
            ],
          };
        }
    
        try {
          const savedStatus = await handleSpotifyRequest(async (spotifyApi) => {
            return await spotifyApi.currentUser.albums.hasSavedAlbums(albumIds);
          });
    
          const formattedResults = albumIds
            .map((albumId, i) => {
              const isSaved = savedStatus[i];
              return `${i + 1}. ${albumId}: ${isSaved ? 'Saved' : 'Not saved'}`;
            })
            .join('\n');
    
          return {
            content: [
              {
                type: 'text',
                text: `# Album Save Status\n\n${formattedResults}`,
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: 'text',
                text: `Error checking saved albums: ${
                  error instanceof Error ? error.message : String(error)
                }`,
              },
            ],
          };
        }
      },
    };
  • Tool name, description, and input schema: albumIds as array of strings (max 20).
    name: 'checkUsersSavedAlbums',
    description: 'Check if albums are saved in the user\'s "Your Music" library',
    schema: {
      albumIds: z
        .array(z.string())
        .max(20)
        .describe('Array of Spotify album IDs to check (max 20)'),
    },
  • src/albums.ts:299-304 (registration)
    Includes the tool in the albumTools array export for later registration.
    export const albumTools = [
      getAlbums,
      getAlbumTracks,
      saveOrRemoveAlbumForUser,
      checkUsersSavedAlbums,
    ];
  • src/index.ts:12-14 (registration)
    Registers the tool on the MCP server by iterating over albumTools (which includes checkUsersSavedAlbums) and calling server.tool with its properties.
    [...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?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool checks saved albums but doesn't reveal key behaviors such as authentication requirements, rate limits, response format, or error handling. For a read operation 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 that directly states the tool's purpose without any wasted words. It's front-loaded and appropriately sized for its function, making it easy for an agent 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 lack of annotations and output schema, the description is incomplete. It doesn't cover behavioral aspects like authentication, rate limits, or response format, which are crucial for a tool interacting with a user's library. For a tool with no structured metadata, more context is needed to be fully helpful.

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 doesn't add any parameter semantics beyond what the input schema provides. Since schema description coverage is 100%, the schema already fully documents the 'albumIds' parameter (array of Spotify album IDs, max 20). The baseline score of 3 is appropriate as the description doesn't compensate but the schema handles the documentation adequately.

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 ('Check if albums are saved') and the resource ('user's "Your Music" library'), making the purpose immediately understandable. However, it doesn't explicitly distinguish this tool from sibling tools like 'getUsersSavedTracks' or 'saveOrRemoveAlbumForUser', which would require more specific differentiation to earn a 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 sibling tools like 'getUsersSavedTracks' (which retrieves saved tracks) or 'saveOrRemoveAlbumForUser' (which modifies saved albums), nor does it specify prerequisites or contexts for use, leaving the agent without usage direction.

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