Skip to main content
Glama

get_user

Retrieve detailed IAM user information including capabilities, MFA status, and group memberships from Oracle Cloud Infrastructure using the user's OCID.

Instructions

Get detailed information about a specific IAM user.

Args:
    user_id: OCID of the user to retrieve

Returns:
    Detailed user information including capabilities, MFA status, and group memberships

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_idYes

Implementation Reference

  • The main handler function for the 'get_user' MCP tool, including registration decorator @mcp.tool(name='get_user') and wrapper decorator. It takes user_id and calls the helper get_user with the identity client.
    @mcp.tool(name="get_user")
    @mcp_tool_wrapper(
        start_msg="Getting user details for {user_id}...",
        success_msg="Retrieved user details successfully",
        error_prefix="Error getting user details"
    )
    async def mcp_get_user(ctx: Context, user_id: str) -> Dict[str, Any]:
        """
        Get detailed information about a specific IAM user.
    
        Args:
            user_id: OCID of the user to retrieve
    
        Returns:
            Detailed user information including capabilities, MFA status, and group memberships
        """
        return get_user(oci_clients["identity"], user_id)
  • MCP tool registration using @mcp.tool decorator with name 'get_user'.
    @mcp.tool(name="get_user")
  • Helper function that implements the core logic for retrieving OCI user details using the OCI SDK, called by the MCP handler.
    def get_user(identity_client: oci.identity.IdentityClient, user_id: str) -> Dict[str, Any]:
        """
        Get details of a specific user.
        
        Args:
            identity_client: OCI Identity client
            user_id: OCID of the user
            
        Returns:
            Details of the user
        """
        try:
            user = identity_client.get_user(user_id).data
            
            user_details = {
                "id": user.id,
                "name": user.name,
                "description": user.description,
                "email": user.email,
                "email_verified": user.email_verified,
                "is_mfa_activated": user.is_mfa_activated,
                "lifecycle_state": user.lifecycle_state,
                "time_created": str(user.time_created),
                "compartment_id": user.compartment_id,
                "capabilities": {
                    "can_use_console_password": user.capabilities.can_use_console_password if user.capabilities else None,
                    "can_use_api_keys": user.capabilities.can_use_api_keys if user.capabilities else None,
                    "can_use_auth_tokens": user.capabilities.can_use_auth_tokens if user.capabilities else None,
                    "can_use_smtp_credentials": user.capabilities.can_use_smtp_credentials if user.capabilities else None,
                } if user.capabilities else None,
            }
            
            logger.info(f"Retrieved details for user {user_id}")
            return user_details
            
        except Exception as e:
            logger.exception(f"Error getting user details: {e}")
            raise
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While it indicates this is a read operation ('Get detailed information'), it doesn't mention authentication requirements, rate limits, error conditions, or whether the operation is idempotent. For a tool accessing IAM resources with no annotation coverage, this represents a significant gap.

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 efficiently structured with a clear purpose statement followed by Args and Returns sections. Every sentence earns its place: the first establishes the tool's function, the second clarifies the single parameter, and the third describes the return value. No wasted words or redundancy.

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 single-parameter read tool with no output schema, the description provides adequate but minimal coverage. It explains what the tool does and what it returns, but lacks important context about authentication, error handling, and differentiation from sibling tools. The absence of annotations means the description should do more to compensate, particularly for an IAM-related operation.

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?

With 0% schema description coverage and only one parameter, the description adds substantial value by explaining that 'user_id' is an 'OCID of the user to retrieve'. This provides crucial semantic context that the schema alone lacks. The description doesn't explain OCID format or where to obtain it, but it meaningfully compensates for the schema's lack of documentation.

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 with a specific verb ('Get detailed information') and resource ('about a specific IAM user'), making it easy to understand what the tool does. However, it doesn't explicitly differentiate from sibling tools like 'list_users' or 'get_group', which provide related but different functionality.

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 'get_user' over 'list_users' (which likely returns multiple users) or 'get_group' (which might return group information including users), leaving the agent without context for tool selection.

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/jopsis/mcp-server-oci'

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