Skip to main content
Glama
cswkim

Discogs MCP Server

by cswkim

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
NameRequiredDescriptionDefault
usernameYes
folder_idYes
release_idYes
instance_idYes
ratingNo

Implementation Reference

  • MCP tool definition and handler (execute function) for 'rate_release_in_user_collection' that delegates to UserService.collection.rateRelease
    export 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);
        }
      },
    };
  • 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(),
      });
  • Registration of the tool in registerUserCollectionTools function
    server.addTool(rateReleaseInUserCollectionTool);
  • Core implementation in UserCollectionService: POST request to Discogs API to rate a specific release instance
    async 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)}`);
      }
    }

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