slack_get_user_profile
Retrieve detailed profile information for a specific Slack user by providing their user ID to access contact details, roles, and workspace information.
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:527-537 (handler)Handler case within the CallToolRequest handler that validates the user_id argument and calls the SlackClient.getUserProfile method to fetch and return the user profile data.case "slack_get_user_profile": { const args = request.params .arguments as unknown as GetUserProfileArgs; if (!args.user_id) { throw new Error("Missing required argument: user_id"); } const response = await slackClient.getUserProfile(args.user_id); return { content: [{ type: "text", text: JSON.stringify(response) }], }; }
- index.ts:198-211 (schema)Defines the tool's metadata, description, and input schema used for validation in MCP.const getUserProfileTool: Tool = { name: "slack_get_user_profile", description: "Get detailed profile information for a specific user", inputSchema: { type: "object", properties: { user_id: { type: "string", description: "The ID of the user", }, }, required: ["user_id"], }, };
- index.ts:569-582 (registration)The ListToolsRequest handler returns the list of available tools, registering slack_get_user_profile by including getUserProfileTool in the array.return { tools: [ listChannelsTool, postMessageTool, replyToThreadTool, addReactionTool, getChannelHistoryTool, getThreadRepliesTool, getUsersTool, getUserProfileTool, lookupUserByEmailTool, ], }; });
- index.ts:370-382 (helper)SlackClient class method implementing the core logic: calls Slack's users.profile.get API to retrieve detailed user profile.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 expected arguments for the tool handler.interface GetUserProfileArgs { user_id: string; }