Skip to main content
Glama
cswkim

Discogs MCP Server

by cswkim

get_artist_releases

Retrieve an artist's discography from Discogs by providing the artist ID, with options to sort by year, title, or format and control pagination.

Instructions

Get an artist's releases

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
artist_idYes
pageNo
per_pageNo
sortNo
sort_orderNo

Implementation Reference

  • Defines the MCP tool 'get_artist_releases' with its execute handler that delegates to ArtistService.getReleases and returns JSON stringified response.
    export const getArtistReleasesTool: Tool<FastMCPSessionAuth, typeof ArtistReleasesParamsSchema> = { name: 'get_artist_releases', description: `Get an artist's releases`, parameters: ArtistReleasesParamsSchema, execute: async (args) => { try { const artistService = new ArtistService(); const artistReleases = await artistService.getReleases(args); return JSON.stringify(artistReleases); } catch (error) { throw formatDiscogsError(error); } }, };
  • Zod schema defining the input parameters for the get_artist_releases tool, merging artist_id with query params.
    export const ArtistReleasesParamsSchema = ArtistIdParamSchema.merge( QueryParamsSchema(['year', 'title', 'format'] as const), );
  • Function that registers all database-related tools, including getArtistReleasesTool, on the FastMCP server.
    export function registerDatabaseTools(server: FastMCP): void { server.addTool(getReleaseTool); server.addTool(getReleaseRatingTool); server.addTool(editReleaseRatingTool); server.addTool(deleteReleaseRatingTool); server.addTool(getReleaseCommunityRatingTool); server.addTool(getMasterReleaseTool); server.addTool(getMasterReleaseVersionsTool); server.addTool(getArtistTool); server.addTool(getArtistReleasesTool); server.addTool(getLabelTool); server.addTool(getLabelReleasesTool); server.addTool(searchTool); }
  • Implementation in ArtistService that performs the HTTP request to Discogs API endpoint for retrieving the artist's releases, validates response, and handles errors.
    async getReleases({ artist_id, ...options }: ArtistReleasesParams): Promise<ArtistReleases> { try { const response = await this.request<ArtistReleases>(`/${artist_id}/releases`, { params: options, }); const validatedResponse = ArtistReleasesSchema.parse(response); return validatedResponse; } catch (error) { if (isDiscogsError(error)) { throw error; } throw new Error(`Failed to get artist releases: ${String(error)}`); } }

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/cswkim/discogs-mcp-server'

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