get_user_submissions
Fetch all submissions made by a specific Discogs user using their username.
Instructions
Retrieve a user's submissions by username
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| username | Yes |
Implementation Reference
- src/services/user/contribution.ts:39-62 (handler)UserSubmissionsService class with the get() method that makes the HTTP request to fetch a user's submissions from the Discogs API at /users/{username}/submissions. Validates the response using SubmissionsResponseSchema.
export class UserSubmissionsService extends BaseUserService { /** * Retrieve a user's submissions by username * * @param username The username of the user to get submissions for * @throws {DiscogsResourceNotFoundError} If the username is not found * @throws {DiscogsError} If there's an unexpected error * @returns {SubmissionResponse} The user's submissions */ async get({ username }: UsernameInput): Promise<SubmissionResponse> { try { const response = await this.request<SubmissionResponse>(`/${username}/submissions`); const validatedResponse = SubmissionsResponseSchema.parse(response); return validatedResponse; } catch (error) { if (isDiscogsError(error)) { throw error; } throw new Error(`Failed to get user submissions: ${String(error)}`, { cause: error }); } } } - src/tools/userIdentity.ts:52-66 (handler)Tool definition for 'get_user_submissions'. Instantiates UserSubmissionsService and calls its get() method with the username argument, returning the JSON-stringified result.
export const getUserSubmissionsTool: Tool<FastMCPSessionAuth, typeof UsernameInputSchema> = { name: 'get_user_submissions', description: `Retrieve a user's submissions by username`, parameters: UsernameInputSchema, execute: async (args) => { try { const userSubmissionsService = new UserSubmissionsService(); const submissions = await userSubmissionsService.get(args); return JSON.stringify(submissions); } catch (error) { throw formatDiscogsError(error); } }, }; - src/types/common.ts:123-125 (schema)UsernameInputSchema: defines the input schema requiring a 'username' string (min length 1). Used as the parameters schema for the get_user_submissions tool.
export const UsernameInputSchema = z.object({ username: z.string().min(1, 'username is required'), }); - src/types/user/contribution.ts:33-36 (schema)SubmissionsResponseSchema: defines the shape of the submissions response using PaginatedResponseWithObjectSchema with SubmissionSchema (containing artists, labels, releases) under the 'submissions' key.
export const SubmissionsResponseSchema = PaginatedResponseWithObjectSchema( SubmissionSchema, 'submissions', ); - src/tools/userIdentity.ts:107-113 (registration)registerUserIdentityTools function that registers the getUserSubmissionsTool (and other user identity tools) with the FastMCP server. Called from src/tools/index.ts at line 19.
export function registerUserIdentityTools(server: FastMCP): void { server.addTool(getUserIdentityTool); server.addTool(getUserProfileTool); server.addTool(editUserProfileTool); server.addTool(getUserSubmissionsTool); server.addTool(getUserContributionsTool); }