edit_user_profile
Update user profile information on Discogs, including name, location, website, currency preference, and personal bio.
Instructions
Edit a user's profile data
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| username | Yes | ||
| name | No | ||
| home_page | No | ||
| location | No | ||
| profile | No | ||
| curr_abbr | No |
Implementation Reference
- src/tools/userIdentity.ts:91-105 (handler)Tool definition and execute handler for 'edit_user_profile', which invokes the UserService to perform the profile edit.export const editUserProfileTool: Tool<FastMCPSessionAuth, typeof UserProfileEditInputSchema> = { name: 'edit_user_profile', description: `Edit a user's profile data`, parameters: UserProfileEditInputSchema, execute: async (args) => { try { const userService = new UserService(); const profile = await userService.profile.edit(args); return JSON.stringify(profile); } catch (error) { throw formatDiscogsError(error); } }, };
- src/types/user/profile.ts:54-61 (schema)Zod input schema for validating parameters to the edit_user_profile tool.export const UserProfileEditInputSchema = z.object({ ...UsernameInputSchema.shape, name: z.string().optional(), home_page: urlOrEmptySchema().optional(), location: z.string().optional(), profile: z.string().optional(), curr_abbr: CurrencyCodeSchema.optional(), });
- src/tools/userIdentity.ts:107-113 (registration)Registration function that adds the editUserProfileTool to the MCP server.export function registerUserIdentityTools(server: FastMCP): void { server.addTool(getUserIdentityTool); server.addTool(getUserProfileTool); server.addTool(editUserProfileTool); server.addTool(getUserSubmissionsTool); server.addTool(getUserContributionsTool); }
- src/services/user/profile.ts:51-70 (helper)Core implementation of profile editing via POST request to Discogs API, called by the tool handler.async edit({ username, ...body }: UserProfileEditInput): Promise<UserProfile> { try { const response = await this.request<UserProfile>(`/${username}`, { method: 'POST', body, }); // Validate the response using Zod schema const validatedResponse = UserProfileSchema.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 edit profile: ${String(error)}`); } }