Skip to main content
Glama
z9905080
by z9905080

slack_get_users

Retrieve a paginated list of all workspace users with their basic profile information to access team member details and manage user data.

Instructions

Get a list of all users in the workspace with their basic profile 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 in the CallToolRequest switch statement. Extracts arguments, calls slackClient.getUsers, and returns the JSON response.
    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 schema definition for slack_get_users, specifying name, description, and input schema with optional cursor and limit.
    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, }, }, }, };
  • SlackClient.getUsers method: constructs query params for Slack users.list API, fetches and returns the response.
    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.botHeaders, }); return response.json(); }
  • index.ts:567-582 (registration)
    Registration of slack_get_users tool (as getUsersTool) in the ListToolsRequest handler's tools array.
    server.setRequestHandler(ListToolsRequestSchema, async () => { console.log("Received ListToolsRequest"); return { tools: [ listChannelsTool, postMessageTool, replyToThreadTool, addReactionTool, getChannelHistoryTool, getThreadRepliesTool, getUsersTool, getUserProfileTool, lookupUserByEmailTool, ], }; });
  • TypeScript interface defining input arguments for slack_get_users tool.
    interface GetUsersArgs { cursor?: string; limit?: number; }

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

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