Skip to main content
Glama

list_users

Retrieve a list of users from your Slack workspace to manage team members and access contact information.

Instructions

List users in the Slack workspace

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of users to return

Implementation Reference

  • The handler function for the 'list_users' tool. It validates input args using listUsersSchema, calls the Slack users.list API with limit and cursor parameters, and returns members list and next_cursor.
    export async function listUsers(client: SlackClientWrapper, args: unknown) { const params = listUsersSchema.parse(args); return await client.safeCall(async () => { const result = await client.getClient().users.list({ limit: params.limit, cursor: params.cursor, }); return { members: result.members || [], next_cursor: result.response_metadata?.next_cursor, }; }); }
  • Zod schema used for input validation in the listUsers handler, defining optional limit and cursor parameters.
    export const listUsersSchema = z.object({ limit: z.number().min(1).max(1000).optional().default(100), cursor: z.string().optional(), });
  • src/index.ts:122-136 (registration)
    Tool registration in the list_tools response: defines name 'list_users', description, and JSON inputSchema matching the Zod schema.
    name: 'list_users', description: 'List users in the Slack workspace', inputSchema: { type: 'object', properties: { limit: { type: 'number', description: 'Maximum number of users to return', default: 100, minimum: 1, maximum: 1000, }, }, }, },
  • src/index.ts:421-421 (registration)
    Handler binding in the toolHandlers map: maps 'list_users' calls to userTools.listUsers function with slackClient.
    list_users: (args) => userTools.listUsers(slackClient, args),

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Hais/slack-bot-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server