get_user_profile
Retrieve LeetCode user profile data including stats, solved problems, and profile details by providing a username.
Instructions
Retrieves profile information about a LeetCode user, including user stats, solved problems, and profile details
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| username | Yes | LeetCode username to retrieve profile information for |
Implementation Reference
- src/mcp/tools/user-tools.ts:24-38 (handler)The inline async handler function for the get_user_profile tool. It takes a username, fetches the profile data from the LeetCode service, and returns it as a text content block containing JSON with the username and profile data.async ({ username }) => { const data = await this.leetcodeService.fetchUserProfile(username); return { content: [ { type: "text", text: JSON.stringify({ username: username, profile: data }) } ] }; }
- src/mcp/tools/user-tools.ts:17-23 (schema)Zod input schema defining the required 'username' parameter as a string with description.{ username: z .string() .describe( "LeetCode username to retrieve profile information for" ) },
- src/mcp/tools/user-tools.ts:14-39 (registration)Registration of the 'get_user_profile' tool using server.tool(), including the tool name, description, input schema, and inline handler function within the UserToolRegistry's registerCommon method.this.server.tool( "get_user_profile", "Retrieves profile information about a LeetCode user, including user stats, solved problems, and profile details", { username: z .string() .describe( "LeetCode username to retrieve profile information for" ) }, async ({ username }) => { const data = await this.leetcodeService.fetchUserProfile(username); return { content: [ { type: "text", text: JSON.stringify({ username: username, profile: data }) } ] }; } );