Skip to main content
Glama

get_user_info

Retrieve Slack user information by entering a display name or real name to identify team members and access their details.

Instructions

Get Slack user info by username or real name.

Args:
    username: Slack display name or real name (not user ID).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
usernameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • main.py:57-94 (handler)
    The main handler function for the 'get_user_info' tool. It is registered via the @mcp.tool() decorator and implements the logic to retrieve Slack user information by searching the users.list and then fetching detailed info with users.info.
    @mcp.tool()
    async def get_user_info(username: str) -> str:
        """
        Get Slack user info by username or real name.
    
        Args:
            username: Slack display name or real name (not user ID).
        """
        # Step 1: Get list of all users
        users_data = await make_slack_request("users.list")
        if not users_data or not users_data.get("ok"):
            return "โŒ Failed to fetch user list."
    
        # Step 2: Search for the user
        user_id = None
        for user in users_data["members"]:
            if user.get("name") == username or user.get("real_name") == username:
                user_id = user["id"]
                break
    
        if not user_id:
            return f"โŒ User '{username}' not found."
    
        # Step 3: Use user_id to get full user info
        params = {"user": user_id}
        data = await make_slack_request("users.info", params)
        if not data or not data.get("ok"):
            return "โŒ Failed to fetch user info."
    
        user = data.get("user", {})
        profile = user.get("profile", {})
    
        return (
            f"๐Ÿ‘ค Username: {user.get('name')}\n"
            f"๐Ÿงพ Real Name: {user.get('real_name')}\n"
            f"๐Ÿ“ง Email: {profile.get('email', 'N/A')}\n"
            f"๐Ÿ†” ID: {user_id}"
        )
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions that the tool retrieves user info but doesn't specify what info is returned (e.g., profile details, status), whether it requires authentication, rate limits, or error handling. This leaves significant gaps in understanding the tool's behavior beyond basic functionality.

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

Conciseness4/5

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

The description is appropriately sized and front-loaded, with the main purpose stated clearly in the first sentence. The additional parameter explanation is concise and adds value without redundancy. However, the formatting with quotes and line breaks slightly detracts from optimal structure.

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 that there's an output schema (which should cover return values), the description doesn't need to explain outputs. However, for a tool with no annotations and only basic parameter info, it lacks details on behavioral aspects like authentication or error cases. It's adequate but has clear gaps in providing a complete context for effective use.

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

Parameters4/5

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

The description adds meaningful context for the single parameter: 'username: Slack display name or real name (not user ID).' This clarifies the parameter's purpose and constraints beyond the schema, which has 0% description coverage. Since there's only one parameter and the description compensates well, it earns a high score.

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 tool's purpose: 'Get Slack user info by username or real name.' It specifies the verb ('Get'), resource ('Slack user info'), and scope ('by username or real name'), making it easy to understand what the tool does. However, it doesn't explicitly distinguish this tool from its sibling tools (e.g., get_user_messages), which slightly limits its differentiation.

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 by specifying 'by username or real name' and noting that it's 'not user ID,' which helps clarify when to use this tool versus alternatives that might use IDs. However, it doesn't explicitly state when to use this tool over siblings like get_user_messages or provide clear exclusions, leaving some ambiguity.

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/Abu-BakarYasir/my_slack_mcp'

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