Skip to main content
Glama
makesh-kumar

Spotify MCP Server

by makesh-kumar

checkUsersSavedAlbums

Verify which albums are saved in your Spotify library by checking up to 20 album IDs at once. This tool helps you confirm album status in "Your Music" without manual searching.

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 main handler function for the 'checkUsersSavedAlbums' tool. It validates input, calls the Spotify API to check saved status for the provided album IDs, formats the results, and returns a markdown response with the status of each album.
    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)
              }`,
            },
          ],
        };
      }
    },
  • Zod schema defining the input parameters for the tool: an array of up to 20 Spotify album IDs.
    schema: {
      albumIds: z
        .array(z.string())
        .max(20)
        .describe('Array of Spotify album IDs to check (max 20)'),
    },
  • src/index.ts:12-14 (registration)
    Registration of all tools, including 'checkUsersSavedAlbums' from albumTools, by calling server.tool() with name, description, schema, and handler.
    [...readTools, ...playTools, ...albumTools].forEach((tool) => {
      server.tool(tool.name, tool.description, tool.schema, tool.handler);
    });
  • src/albums.ts:299-304 (registration)
    Export of albumTools array including the checkUsersSavedAlbums tool, which is later imported and registered in index.ts.
    export const albumTools = [
      getAlbums,
      getAlbumTracks,
      saveOrRemoveAlbumForUser,
      checkUsersSavedAlbums,
    ];
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 what the tool does but lacks details on permissions required, rate limits, error handling, or what the return value looks like (e.g., boolean array, status codes). This is a significant gap for a tool with no annotation coverage.

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 is appropriately sized and front-loaded, making it easy to understand at a glance.

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 (checking saved albums), lack of annotations, and no output schema, the description is incomplete. It doesn't cover behavioral aspects like authentication needs, response format, or error conditions, leaving gaps that could hinder an AI agent's ability to use the tool effectively.

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 the parameter 'albumIds' fully documented in the schema. The description doesn't add any meaning beyond what the schema provides, such as explaining the format of Spotify album IDs or the significance of the max 20 limit. Baseline 3 is appropriate when the schema does the heavy lifting.

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 verb 'check' and the resource 'albums saved in the user's "Your Music" library', making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like 'getUsersSavedTracks' or 'saveOrRemoveAlbumForUser', which handle similar resources but different operations.

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. For example, it doesn't mention when to use 'checkUsersSavedAlbums' instead of 'getUsersSavedTracks' or 'saveOrRemoveAlbumForUser', nor does it specify prerequisites like user authentication or context for checking saved albums.

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

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