Skip to main content
Glama
cswkim

Discogs MCP Server

by cswkim

get_user_profile

Retrieve user profiles from Discogs by username to access collection details and music preferences.

Instructions

Retrieve a user by username

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
usernameYes

Implementation Reference

  • The tool definition and handler (execute function) for 'get_user_profile', which retrieves a Discogs user profile by username using UserService.
    export const getUserProfileTool: Tool<FastMCPSessionAuth, typeof UsernameInputSchema> = {
      name: 'get_user_profile',
      description: 'Retrieve a user by username',
      parameters: UsernameInputSchema,
      execute: async (args) => {
        try {
          const userService = new UserService();
          const profile = await userService.profile.get(args);
    
          return JSON.stringify(profile);
        } catch (error) {
          throw formatDiscogsError(error);
        }
      },
    };
  • Zod input schema for the 'get_user_profile' tool, defining the required 'username' parameter.
    export const UsernameInputSchema = z.object({
      username: z.string().min(1, 'username is required'),
    });
  • Direct registration of the getUserProfileTool in the registerUserIdentityTools function.
    server.addTool(getUserProfileTool);
  • Invocation of registerUserIdentityTools which registers the get_user_profile tool among others.
    registerUserIdentityTools(server);
  • src/index.ts:32-32 (registration)
    Top-level registration call that ultimately registers all tools including get_user_profile.
    registerTools(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