Get Slack User Profile
slack_get_user_profileRetrieve detailed profile information for a specific Slack user by providing their user ID. Essential for accessing user details like name, email, and role within a workspace.
Instructions
Get detailed profile information for a specific user
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| user_id | Yes | The ID of the user |
Implementation Reference
- index.ts:358-373 (registration)Registration of the slack_get_user_profile tool using server.registerTool with input schema and handler callback.
server.registerTool( "slack_get_user_profile", { title: "Get Slack User Profile", description: "Get detailed profile information for a specific user", inputSchema: { user_id: z.string().describe("The ID of the user"), }, }, async ({ user_id }) => { const response = await slackClient.getUserProfile(user_id); return { content: [{ type: "text", text: JSON.stringify(response) }], }; } ); - index.ts:208-220 (handler)The SlackClient.getUserProfile method that executes the tool logic by calling Slack's users.profile.get API with the user_id parameter.
async getUserProfile(user_id: string): Promise<any> { const params = new URLSearchParams({ user: user_id, include_labels: "true", }); const response = await fetch( `https://slack.com/api/users.profile.get?${params}`, { headers: this.botHeaders }, ); return response.json(); } - index.ts:49-51 (schema)TypeScript interface defining the input arguments for getUserProfile (user_id string).
interface GetUserProfileArgs { user_id: string; }