Skip to main content
Glama
z9905080

MCP Server for Slack

by z9905080

slack_get_users

Retrieve workspace user lists with profile details to identify team members and manage Slack interactions.

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 case in CallToolRequest that parses 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 including name, description, and inputSchema for pagination.
    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 method implementing the core logic: calls Slack users.list API with pagination params.
    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:570-580 (registration)
    Registration of the tool in the ListToolsRequest handler's tools array.
    tools: [
      listChannelsTool,
      postMessageTool,
      replyToThreadTool,
      addReactionTool,
      getChannelHistoryTool,
      getThreadRepliesTool,
      getUsersTool,
      getUserProfileTool,
      lookupUserByEmailTool,
    ],
  • TypeScript interface for tool arguments used in handler type casting.
    interface GetUsersArgs {
      cursor?: string;
      limit?: number;
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states it 'Get[s] a list' but doesn't mention whether this requires specific permissions, rate limits, pagination behavior beyond the cursor parameter, or what 'basic profile information' includes. For a tool with no annotation coverage, this leaves significant gaps in understanding its operational traits.

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?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, with every part contributing essential information, making it highly concise and well-structured.

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 the tool's moderate complexity (list retrieval with pagination), no annotations, and no output schema, the description is minimally adequate but incomplete. It covers the basic purpose but lacks details on permissions, rate limits, output format, or how to interpret 'basic profile information', leaving gaps that could hinder effective agent use.

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?

The schema description coverage is 100%, with clear descriptions for both parameters (cursor for pagination, limit with default and max). The description adds no additional parameter semantics beyond what the schema provides, such as explaining how pagination works or typical use cases for limit adjustments. Baseline 3 is appropriate as the 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 their basic profile information', making the purpose unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'slack_get_user_profile' (which might get detailed info for a single user) or 'lookup_user_by_email' (which finds specific users), missing full sibling differentiation.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when to choose this over 'lookup_user_by_email' for finding specific users, 'slack_get_user_profile' for detailed single-user info, or other sibling tools, leaving the agent without explicit usage context.

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

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