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) }],
        };
      }
    );

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.0.0
    • addedInput schema / $schema
      Added value: +"http://json-schema.org/draft-07/schema#"
    • addedInput schema / additionalProperties
      Added value: +false
  2. First observed

TDQS

A3.5/5.0
Behavior2/5

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

No annotations are provided, so the description must disclose behavioral traits. It states 'Get' which is read-only, but it does not mention pagination (evident from schema), rate limits, or data freshness. For a list tool, this is minimal disclosure.

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?

One sentence with no redundant information. It is front-loaded with the action and resource, making it efficient.

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?

Given no output schema, the description could explain what 'basic profile information' includes. It does not, leaving some ambiguity. Additionally, without annotations, it should mention authentication requirements, but that is standard. Overall adequate 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%, so the description does not need to add parameter details beyond what the schema provides. However, it adds no additional context about how to use cursor or limit effectively.

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?

The description clearly states the action 'Get', the resource 'a list of all users', and the scope 'in the workspace with their basic profile information'. This is specific and distinguishes it from siblings like slack_get_user_profile.

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

Usage Guidelines3/5

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

The description does not explicitly state when to use this tool vs alternatives (e.g., slack_get_user_profile for a single user). Usage context is implied but not guided, and there are no exclusions or when-not-to-use hints.

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