Skip to main content
Glama
panther-labs

Panther MCP Server

Official

get_user

Read-only

Retrieve detailed user information from Panther's security platform by providing a user ID. Returns email, names, role, authentication status, and timestamps for security monitoring and investigation.

Instructions

Get detailed information about a Panther user by ID

Returns complete user information including email, names, role, authentication status, and timestamps.

Permissions:{'all_of': ['Read User Info']}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_idYesThe ID of the user to fetch

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the "get_user" MCP tool. It fetches detailed user information from the Panther REST API endpoint `/users/{user_id}`. Handles 404 not found and other errors, returning structured success/failure responses. Input schema defined via Annotated[str, Field(...)] with description and examples. Decorated with @mcp_tool for automatic registration, including permissions.
    @mcp_tool(
        annotations={
            "permissions": all_perms(Permission.USER_READ),
            "readOnlyHint": True,
        }
    )
    async def get_user(
        user_id: Annotated[
            str,
            Field(
                description="The ID of the user to fetch",
                examples=["user-123", "john.doe@company.com", "<admin@example.com>"],
            ),
        ],
    ) -> dict[str, Any]:
        """Get detailed information about a Panther user by ID
    
        Returns complete user information including email, names, role, authentication status, and timestamps.
        """
        logger.info(f"Fetching user details for user ID: {user_id}")
    
        try:
            async with get_rest_client() as client:
                # Allow 404 as a valid response to handle not found case
                result, status = await client.get(
                    f"/users/{user_id}", expected_codes=[200, 404]
                )
    
                if status == 404:
                    logger.warning(f"No user found with ID: {user_id}")
                    return {
                        "success": False,
                        "message": f"No user found with ID: {user_id}",
                    }
    
            logger.info(f"Successfully retrieved user details for user ID: {user_id}")
            return {"success": True, "user": result}
        except Exception as e:
            logger.error(f"Failed to get user details: {str(e)}")
            return {
                "success": False,
                "message": f"Failed to get user details: {str(e)}",
            }
  • Registers all auto-discovered MCP tools (including "get_user") with the FastMCP server instance via register_all_tools(mcp). This is the point where tools become available to the MCP protocol.
    # Note: Dependencies are declared in fastmcp.json for FastMCP v2.14.0+
    mcp = FastMCP(MCP_SERVER_NAME, lifespan=lifespan)
    
    # Register all tools with MCP using the registry
    register_all_tools(mcp)
    # Register all prompts with MCP using the registry
    register_all_prompts(mcp)
    # Register all resources with MCP using the registry
    register_all_resources(mcp)
  • The registry mechanism that collects all @mcp_tool decorated functions and registers them with the MCP server using FastMCP's tool() decorator, preserving name, description, and annotations like permissions.
    def register_all_tools(mcp_instance) -> None:
        """
        Register all tools marked with @mcp_tool with the given MCP instance.
    
        Args:
            mcp_instance: The FastMCP instance to register tools with
        """
        logger.info(f"Registering {len(_tool_registry)} tools with MCP")
    
        # Sort tools by name
        sorted_funcs = sorted(_tool_registry, key=lambda f: f.__name__)
        for tool in sorted_funcs:
            logger.debug(f"Registering tool: {tool.__name__}")
    
            # Get tool metadata if it exists
            metadata = getattr(tool, "_mcp_tool_metadata", {})
    
            annotations = metadata.get("annotations", {})
            # Create tool decorator with metadata
            tool_decorator = mcp_instance.tool(
                name=metadata.get("name"),
                description=metadata.get("description"),
                annotations=annotations,
            )
    
            if annotations and annotations.get("permissions"):
                if not tool.__doc__:
                    tool.__doc__ = ""
                tool.__doc__ += f"\n\n Permissions:{annotations.get('permissions')}"
    
            # Register the tool
            tool_decorator(tool)
    
        logger.info("All tools registered successfully")
Behavior4/5

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

Annotations provide readOnlyHint=true, and the description adds valuable context beyond this: it specifies the permission requirement ('Permissions:{'all_of': ['Read User Info']}') and details what information is returned (email, names, role, etc.). This enhances understanding of behavioral traits without contradicting annotations.

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 core purpose, followed by return details and permissions. It avoids redundancy, but the formatting with extra spaces slightly affects structure. Overall, it's efficient with minimal waste.

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

Completeness5/5

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

Given the tool's low complexity, high schema coverage, presence of annotations, and an output schema, the description is complete enough. It covers purpose, return values, and permissions, addressing key contextual needs without unnecessary elaboration.

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 the parameter 'user_id' well-documented in the schema. The description does not add significant meaning beyond the schema, as it only mentions 'by ID' without further details. Baseline 3 is appropriate given high schema coverage.

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 specific action ('Get detailed information') and resource ('a Panther user by ID'), distinguishing it from sibling tools like 'list_users' which returns multiple users. It precisely defines what the tool does without being vague or tautological.

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 ID' and listing returned fields, but does not explicitly state when to use this tool versus alternatives like 'list_users' or other user-related tools. No explicit guidance on prerequisites or exclusions is provided.

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/panther-labs/mcp-panther'

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