slack_get_users
Retrieve workspace user profiles to manage team information and access permissions through Slack API integration.
Instructions
Retrieve basic profile information of all users in the workspace
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) |
Implementation Reference
- src/index.ts:291-305 (handler)Handler for slack_get_users tool: parses arguments, calls slackClient.users.list with limit and cursor, validates response with GetUsersResponseSchema, and returns JSON string of parsed users list.case 'slack_get_users': { const args = GetUsersRequestSchema.parse(request.params.arguments); const response = await slackClient.users.list({ limit: args.limit, cursor: args.cursor, }); if (!response.ok) { throw new Error(`Failed to get users: ${response.error}`); } const parsed = GetUsersResponseSchema.parse(response); return { content: [{ type: 'text', text: JSON.stringify(parsed) }], }; }
- src/index.ts:147-152 (registration)Tool registration in ListToolsRequestSchema handler, defining name, description, and input schema for slack_get_users.{ name: 'slack_get_users', description: 'Retrieve basic profile information of all users in the workspace', inputSchema: zodToJsonSchema(GetUsersRequestSchema), },
- src/schemas.ts:162-174 (schema)Input schema (GetUsersRequestSchema) for slack_get_users tool: optional cursor and limit parameters.export const GetUsersRequestSchema = z.object({ cursor: z .string() .optional() .describe('Pagination cursor for next page of results'), limit: z .number() .int() .min(1) .optional() .default(100) .describe('Maximum number of users to return (default 100)'), });
- src/schemas.ts:398-400 (schema)Output schema (GetUsersResponseSchema) for slack_get_users: extends BaseResponseSchema with array of MemberSchema.export const GetUsersResponseSchema = BaseResponseSchema.extend({ members: z.array(MemberSchema).optional(), });
- src/schemas.ts:59-65 (helper)MemberSchema used in GetUsersResponseSchema: defines basic user fields id, name, real_name.const MemberSchema = z .object({ id: z.string().optional(), name: z.string().optional(), real_name: z.string().optional(), }) .strip();