Skip to main content
Glama
AVIMBU
by AVIMBU

slack_get_users

Retrieve a list of all users in a Slack workspace, including basic user information. Supports pagination with cursor and limits the number of results returned.

Instructions

Get a list of all users in the workspace with basic information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cursorNoPagination cursor for next page of results
limitNoMaximum number of users to return (default 100, max 200)

Implementation Reference

  • Handler for the slack_get_users tool: parses arguments, calls slackClient.getUsers, and returns the response as JSON text.
    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) }], }; }
  • Tool definition including name, description, and input schema for slack_get_users.
    export const getUsersTool: Tool = { name: "slack_get_users", description: "Get a list of all users in the workspace with basic 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, }, }, }, };
  • Core implementation that fetches the list of users from Slack's users.list API endpoint.
    async getUsers(limit: number = 100, cursor?: string): Promise<any> { const params = new URLSearchParams({ limit: Math.min(limit, 200).toString(), team_id: SlackClient.TEAM_ID, }); if (cursor) { params.append("cursor", cursor); } const response = await fetch(`https://slack.com/api/users.list?${params}`, { headers: this.botHeaders, }); return response.json(); }
  • src/index.ts:25-29 (registration)
    Registers slack_get_users (as getUsersTool) among the available tools for ListTools requests.
    server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: [getUsersTool, postMessageTool], }; });
  • TypeScript interface defining the input arguments for the slack_get_users tool.
    export interface GetUsersArgs { cursor?: string; limit?: number; }

Other Tools

Related Tools

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/AVIMBU/slack-mcp-server'

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