Skip to main content
Glama
lars-hagen

Slack User MCP Server

by lars-hagen

slack_get_users

Retrieve workspace user lists with profile details for Slack API integration, supporting pagination and result limits.

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 logic for the slack_get_users tool within the CallToolRequest switch statement. It extracts arguments, calls SlackClient.getUsers, and returns the response as text content.
    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) }],
      };
    }
  • Input schema and metadata definition for the slack_get_users tool.
    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,
          },
        },
      },
    };
  • Core implementation in SlackClient.getUsers method that makes the API call to Slack's users.list endpoint with pagination support.
    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.headers,
      });
    
      return response.json();
    }
  • TypeScript interface defining the input arguments for slack_get_users.
    interface GetUsersArgs {
      cursor?: string;
      limit?: number;
    }
  • index.ts:536-544 (registration)
    Registration of the getUsersTool (slack_get_users) in the tools list returned by the ListToolsRequest handler.
      listChannelsTool,
      postMessageTool,
      replyToThreadTool,
      addReactionTool,
      getChannelHistoryTool,
      getThreadRepliesTool,
      getUsersTool,
      getUserProfileTool,
    ],
Behavior2/5

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

With no annotations provided, the description carries full burden but only states the basic operation. It doesn't disclose behavioral traits like pagination behavior (implied by cursor parameter but not explained), rate limits, authentication requirements, whether it returns deactivated users, or what 'basic profile information' includes. Significant gaps exist for a list operation.

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, zero waste, front-loaded with the core purpose. Every word earns its place without redundancy or unnecessary elaboration.

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 list tool with 2 parameters, 100% schema coverage, but no annotations or output schema, the description is minimally adequate. It states what the tool does but lacks behavioral context (pagination, rate limits, response format) that would help an agent use it effectively. Completeness is borderline viable.

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 both parameters well-documented in the schema. The description adds no parameter-specific information beyond what the schema provides (e.g., doesn't explain how cursor works with limit). Baseline 3 is appropriate when schema does the heavy lifting.

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

Purpose4/5

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

The description clearly states the verb ('Get') and resource ('list of all users in the workspace') with specific scope ('basic profile information'). It distinguishes from sibling tools like slack_get_user_profile (single user) and slack_get_channel_history (different resource), though it doesn't explicitly name alternatives.

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 implies usage for retrieving workspace users, but provides no explicit guidance on when to use this vs. alternatives like slack_get_user_profile for a single user's details, or prerequisites for accessing user lists. Usage context is implied rather than stated.

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/lars-hagen/slack-user-mcp'

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