Skip to main content
Glama
zencoderai

Slack

by zencoderai

Get Slack Users

slack_get_users

Retrieve a list of all users in your Slack workspace along with their basic profile information. Use optional pagination and limit parameters to control the output.

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

  • The getUsers method on SlackClient that executes the Slack API call to fetch users. It calls Slack's users.list endpoint with limit and optional cursor for pagination.
    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();
    }
  • TypeScript interface GetUsersArgs defining the input arguments (cursor and limit) for the getUsers tool.
    interface GetUsersArgs {
      cursor?: string;
      limit?: number;
    }
  • Input schema for the slack_get_users tool using Zod, defining cursor (optional string) and limit (optional number, default 100, max 200) with descriptions.
    {
      title: "Get Slack Users",
      description: "Get a list of all users in the workspace with their basic profile information",
      inputSchema: {
        cursor: z.string().optional().describe("Pagination cursor for next page of results"),
        limit: z.number().optional().default(100).describe("Maximum number of users to return (default 100, max 200)"),
      },
  • index.ts:340-356 (registration)
    Registration of the 'slack_get_users' tool via server.registerTool() with its title, description, input schema, and handler callback.
    server.registerTool(
      "slack_get_users",
      {
        title: "Get Slack Users",
        description: "Get a list of all users in the workspace with their basic profile information",
        inputSchema: {
          cursor: z.string().optional().describe("Pagination cursor for next page of results"),
          limit: z.number().optional().default(100).describe("Maximum number of users to return (default 100, max 200)"),
        },
      },
      async ({ cursor, limit }) => {
        const response = await slackClient.getUsers(limit, cursor);
        return {
          content: [{ type: "text", text: JSON.stringify(response) }],
        };
      }
    );
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description bears full burden. It states 'basic profile information' but doesn't specify fields, and omits mentions of rate limits, caching, or whether only active users are returned. Behavior is minimally disclosed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence with no extraneous information. Direct and efficient for a simple list operation.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no output schema and no annotations, the description is adequate but missing details on return value structure and pagination behavior. Given low complexity, it is minimally viable but not complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% with cursor and limit already described. The description adds no additional meaning beyond the schema, so baseline score of 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states the tool gets a list of all users with basic profile info. Verb 'Get' and resource 'list of all users' are specific, and it distinguishes from siblings like slack_get_user_profile and slack_list_channels.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No indication of when to use this tool vs alternatives like slack_get_user_profile. No mention of prerequisites or when not to use. Guidance is completely absent.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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

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