Skip to main content
Glama
cswkim

Discogs MCP Server

by cswkim

get_user_collection_value

Calculate the minimum, median, and maximum value of a Discogs user's music collection to assess its worth.

Instructions

Returns the minimum, median, and maximum value of a user's collection

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
usernameYes

Implementation Reference

  • Full tool object definition, including the 'execute' handler function that implements the core logic for retrieving the minimum, median, and maximum values of a Discogs user's collection using the UserService.
    export const getUserCollectionValueTool: Tool<FastMCPSessionAuth, typeof UsernameInputSchema> = {
      name: 'get_user_collection_value',
      description: `Returns the minimum, median, and maximum value of a user's collection`,
      parameters: UsernameInputSchema,
      execute: async (args) => {
        try {
          const userService = new UserService();
          const collectionValue = await userService.collection.getValue(args);
    
          return JSON.stringify(collectionValue);
        } catch (error) {
          throw formatDiscogsError(error);
        }
      },
    };
  • Zod input schema used by the tool, requiring a non-empty 'username' string.
    export const UsernameInputSchema = z.object({
      username: z.string().min(1, 'username is required'),
    });
  • Specific registration of the getUserCollectionValueTool to the FastMCP server.
    server.addTool(getUserCollectionValueTool);
  • Module-level registration function for user collection tools, which includes adding the get_user_collection_value tool.
    export function registerUserCollectionTools(server: FastMCP): void {
      server.addTool(getUserCollectionFoldersTool);
      server.addTool(createUserCollectionFolderTool);
      server.addTool(getUserCollectionFolderTool);
      server.addTool(editUserCollectionFolderTool);
      server.addTool(deleteUserCollectionFolderTool);
      server.addTool(findReleaseInUserCollectionTool);
      server.addTool(getUserCollectionItemsTool);
      server.addTool(addReleaseToUserCollectionFolderTool);
      server.addTool(rateReleaseInUserCollectionTool);
      server.addTool(moveReleaseInUserCollectionTool);
      server.addTool(deleteReleaseFromUserCollectionFolderTool);
      server.addTool(getUserCollectionCustomFieldsTool);
      server.addTool(editUserCollectionCustomFieldValueTool);
      server.addTool(getUserCollectionValueTool);
    }
  • Top-level tool registration that invokes the user collection tools registration, indirectly registering get_user_collection_value.
    registerUserCollectionTools(server);

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