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
| Name | Required | Description | Default |
|---|---|---|---|
| release_id | Yes |
Implementation Reference
- src/tools/database.ts:198-213 (handler)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); } }, };
- src/types/release.ts:147-149 (schema)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'), });
- src/tools/database.ts:253-266 (registration)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); }
- src/services/release.ts:114-127 (helper)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)}`); } }
- src/types/release.ts:168-173 (schema)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(), }), });