Skip to main content
Glama
cswkim

Discogs MCP Server

by cswkim

get_user_identity

Retrieve authenticated user information from Discogs to manage music collections and catalog operations.

Instructions

Retrieve basic information about the authenticated user

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool definition for 'get_user_identity', including name, description, empty input schema (z.object({})), and execute handler that fetches user identity via OAuthService and returns JSON string.
    export const getUserIdentityTool: Tool<FastMCPSessionAuth, ToolParameters> = { name: 'get_user_identity', description: 'Retrieve basic information about the authenticated user', parameters: z.object({}), execute: async () => { try { const oauthService = new OAuthService(); const identity = await oauthService.getUserIdentity(); return JSON.stringify(identity); } catch (error) { throw formatDiscogsError(error); } }, };
  • Registration function that adds the 'get_user_identity' tool (and related user tools) to the FastMCP server.
    export function registerUserIdentityTools(server: FastMCP): void { server.addTool(getUserIdentityTool); server.addTool(getUserProfileTool); server.addTool(editUserProfileTool); server.addTool(getUserSubmissionsTool); server.addTool(getUserContributionsTool); }
  • Input schema for the tool: empty object (no parameters required).
    parameters: z.object({}),
  • OAuthService method called by the tool handler to retrieve the authenticated user's identity from Discogs API (/oauth/identity), with Zod validation.
    async getUserIdentity(): Promise<DiscogsUserIdentity> { try { // Call the identity endpoint relative to the OAuth base path const response = await this.request<DiscogsUserIdentity>('/identity'); // Validate the response using Zod schema const validatedResponse = DiscogsUserIdentitySchema.parse(response); return validatedResponse; } catch (error) { // If it's already a Discogs error, just rethrow it if (isDiscogsError(error)) { throw error; } // For validation errors or other unexpected errors, wrap them throw new Error(`Failed to get identity: ${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