Skip to main content
Glama
cswkim

Discogs MCP Server

by cswkim

get_release_community_rating

Retrieve the average community rating and rating count for a specific music release on Discogs using a release ID. Facilitates informed decisions for music catalog management.

Instructions

Retrieves the release community rating average and count

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
release_idYes

Implementation Reference

  • MCP tool handler for 'get_release_community_rating'. Executes by instantiating ReleaseService and calling getCommunityRating on the provided args, returning JSON stringified result.
    export const getReleaseCommunityRatingTool: Tool<FastMCPSessionAuth, typeof ReleaseIdParamSchema> = { name: 'get_release_community_rating', description: 'Retrieves the release community rating average and count', parameters: ReleaseIdParamSchema, execute: async (args) => { try { const releaseService = new ReleaseService(); const releaseRating = await releaseService.getCommunityRating(args); return JSON.stringify(releaseRating); } catch (error) { throw formatDiscogsError(error); } }, };
  • Input schema for the tool: requires a positive integer release_id.
    export const ReleaseIdParamSchema = z.object({ release_id: z.number().min(1, 'The release_id must be non-zero'), });
  • Registration function that adds the getReleaseCommunityRatingTool (and other database tools) to 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); }
  • Core helper method in ReleaseService that fetches the community rating from Discogs API endpoint /releases/{release_id}/rating and validates the response.
    async getCommunityRating({ release_id }: ReleaseIdParam): Promise<ReleaseRatingCommunity> { try { const response = await this.request<ReleaseRatingCommunity>(`/${release_id}/rating`); const validatedResponse = ReleaseRatingCommunitySchema.parse(response); return validatedResponse; } catch (error) { if (isDiscogsError(error)) { throw error; } throw new Error(`Failed to get release community rating: ${String(error)}`); } }
  • Output schema used by the service to validate the community rating response (average and count). Also defines the ReleaseRatingCommunity type.
    export const ReleaseRatingCommunitySchema = ReleaseIdParamSchema.extend({ rating: z.object({ average: z.number(), count: z.number().int(), }), });

Other Tools

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

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