Skip to main content
Glama

get_album

Retrieve Spotify album details including tracks, artists, and release information using the album's Spotify ID or URI.

Instructions

Get Spotify catalog information for an album

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe Spotify ID or URI for the album

Implementation Reference

  • The main handler function that implements the get_album tool logic by extracting the album ID and making an API request to Spotify's /albums/{id} endpoint.
    async getAlbum(args: AlbumArgs) { const albumId = this.extractAlbumId(args.id); return this.api.makeRequest(`/albums/${albumId}`); }
  • src/index.ts:239-250 (registration)
    Tool registration in the ListTools handler, defining the name, description, and input schema for 'get_album'.
    name: 'get_album', description: 'Get Spotify catalog information for an album', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'The Spotify ID or URI for the album' } }, required: ['id'] },
  • src/index.ts:750-756 (registration)
    Dispatch logic in the CallToolRequest handler that validates arguments and calls the getAlbum handler.
    case 'get_album': { const args = this.validateArgs<AlbumArgs>(request.params.arguments, ['id']); const result = await this.albumsHandler.getAlbum(args); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; }
  • TypeScript interface defining the input shape for AlbumArgs used in the handler.
    export interface AlbumArgs { id: string; }
  • Helper method to normalize Spotify album ID from URI or plain ID.
    private extractAlbumId(id: string): string { return id.startsWith('spotify:album:') ? id.split(':')[2] : id; }

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

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