slack_get_user_profile
Retrieve detailed profile information for a specific Slack user by providing their user ID. This tool helps you access user data from Slack workspaces through API integration.
Instructions
Get detailed profile information for a specific user
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| user_id | Yes | The ID of the user |
Implementation Reference
- index.ts:208-220 (handler)Core implementation of the slack_get_user_profile tool logic in SlackClient class, making API call to Slack's users.profile.get endpoint.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:358-373 (registration)Registration of the slack_get_user_profile tool with MCP server, including input schema validation and wrapper handler.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:49-51 (schema)TypeScript interface defining the input arguments for the slack_get_user_profile tool.interface GetUserProfileArgs { user_id: string; }