get_user_submissions
Retrieve a user's submissions from Discogs by entering their username. This tool helps manage and view catalog entries submitted by specific users on the platform.
Instructions
Retrieve a user's submissions by username
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| username | Yes |
Implementation Reference
- src/tools/userIdentity.ts:52-66 (handler)Tool definition including name, description, input schema reference, and execute handler function that invokes UserSubmissionsService to fetch and return user submissions.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)Zod input schema for the username parameter required by the get_user_submissions tool.export const UsernameInputSchema = z.object({ username: z.string().min(1, 'username is required'), });
- src/tools/userIdentity.ts:107-113 (registration)Registration function that adds the getUserSubmissionsTool (among others) 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); }
- Core helper method in UserSubmissionsService that makes the Discogs API request to fetch submissions for a username and validates the response using SubmissionsResponseSchema.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)}`); } }