rate_release_in_user_collection
Assign a rating (1-5) to a specific music release within a user's Discogs collection folder to organize and evaluate personal music catalogs.
Instructions
Rate a release in a user's collection. The folder_id must be non-zero.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| username | Yes | ||
| folder_id | Yes | ||
| release_id | Yes | ||
| instance_id | Yes | ||
| rating | No |
Implementation Reference
- src/tools/userCollection.ts:301-318 (handler)MCP tool definition and handler (execute function) for 'rate_release_in_user_collection' that delegates to UserService.collection.rateReleaseexport const rateReleaseInUserCollectionTool: Tool< FastMCPSessionAuth, typeof UserCollectionReleaseRatingParamsSchema > = { name: 'rate_release_in_user_collection', description: `Rate a release in a user's collection. The folder_id must be non-zero.`, parameters: UserCollectionReleaseRatingParamsSchema, execute: async (args) => { try { const userService = new UserService(); await userService.collection.rateRelease(args); return 'Release rated successfully'; } catch (error) { throw formatDiscogsError(error); } }, };
- src/types/user/collection.ts:149-152 (schema)Zod input schema for rating a release in user collection (extends release deleted params with optional rating 1-5)export const UserCollectionReleaseRatingParamsSchema = UserCollectionReleaseDeletedParamsSchema.extend({ rating: z.number().int().min(1).max(5).optional(), });
- src/tools/userCollection.ts:329-329 (registration)Registration of the tool in registerUserCollectionTools functionserver.addTool(rateReleaseInUserCollectionTool);
- Core implementation in UserCollectionService: POST request to Discogs API to rate a specific release instanceasync rateRelease({ username, folder_id, release_id, instance_id, ...body }: UserCollectionReleaseRatingParams): Promise<void> { try { await this.request<void>( `/${username}/collection/folders/${folder_id}/releases/${release_id}/instances/${instance_id}`, { method: 'POST', body, }, ); } catch (error) { if (isDiscogsError(error)) { throw error; } throw new Error(`Failed to rate release: ${String(error)}`); } }