slack_get_users
Retrieve workspace user lists with profile details for Slack API integration, supporting pagination and result limits.
Instructions
Get a list of all users in the workspace with their basic profile information
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cursor | No | Pagination cursor for next page of results | |
| limit | No | Maximum number of users to return (default 100, max 200) |
Implementation Reference
- index.ts:490-499 (handler)Handler logic for the slack_get_users tool within the CallToolRequest switch statement. It extracts arguments, calls SlackClient.getUsers, and returns the response as text content.case "slack_get_users": { const args = request.params.arguments as unknown as GetUsersArgs; const response = await slackClient.getUsers( args.limit, args.cursor, ); return { content: [{ type: "text", text: JSON.stringify(response) }], }; }
- index.ts:178-196 (schema)Input schema and metadata definition for the slack_get_users tool.const getUsersTool: Tool = { name: "slack_get_users", description: "Get a list of all users in the workspace with their basic profile information", inputSchema: { type: "object", properties: { cursor: { type: "string", description: "Pagination cursor for next page of results", }, limit: { type: "number", description: "Maximum number of users to return (default 100, max 200)", default: 100, }, }, }, };
- index.ts:327-342 (helper)Core implementation in SlackClient.getUsers method that makes the API call to Slack's users.list endpoint with pagination support.async getUsers(limit: number = 100, cursor?: string): Promise<any> { const params = new URLSearchParams({ limit: Math.min(limit, 200).toString(), team_id: process.env.SLACK_TEAM_ID!, }); if (cursor) { params.append("cursor", cursor); } const response = await fetch(`https://slack.com/api/users.list?${params}`, { headers: this.headers, }); return response.json(); }
- index.ts:44-47 (schema)TypeScript interface defining the input arguments for slack_get_users.interface GetUsersArgs { cursor?: string; limit?: number; }
- index.ts:536-544 (registration)Registration of the getUsersTool (slack_get_users) in the tools list returned by the ListToolsRequest handler.listChannelsTool, postMessageTool, replyToThreadTool, addReactionTool, getChannelHistoryTool, getThreadRepliesTool, getUsersTool, getUserProfileTool, ],