Skip to main content
Glama

get_tenancy_info

Retrieve tenancy details including name, home region, and description by providing the tenancy OCID.

Instructions

Get detailed information about a tenancy.

Args:
    tenancy_id: OCID of the tenancy

Returns:
    Tenancy details including name, home region, and description

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tenancy_idYes

Implementation Reference

  • Core implementation of the get_tenancy_info tool handler. Fetches tenancy details using OCI IdentityClient.get_tenancy() and formats the response.
    def get_tenancy_info(identity_client: oci.identity.IdentityClient, tenancy_id: str) -> Dict[str, Any]:
        """
        Get tenancy information.
        
        Args:
            identity_client: OCI Identity client
            tenancy_id: OCID of the tenancy
            
        Returns:
            Tenancy details
        """
        try:
            tenancy = identity_client.get_tenancy(tenancy_id).data
            
            tenancy_details = {
                "id": tenancy.id,
                "name": tenancy.name,
                "description": tenancy.description,
                "home_region_key": tenancy.home_region_key,
                "upi_idcs_compatibility_layer_endpoint": tenancy.upi_idcs_compatibility_layer_endpoint,
            }
            
            logger.info(f"Retrieved tenancy details for {tenancy_id}")
            return tenancy_details
            
        except Exception as e:
            logger.exception(f"Error getting tenancy details: {e}")
            raise
  • MCP tool registration using @mcp.tool(name='get_tenancy_info') decorator. Wraps the core handler with standardized error handling, logging, and profile management via mcp_tool_wrapper.
    @mcp.tool(name="get_tenancy_info")
    @mcp_tool_wrapper(
        start_msg="Getting tenancy information for {tenancy_id}...",
        success_msg="Retrieved tenancy information successfully",
        error_prefix="Error getting tenancy information"
    )
    async def mcp_get_tenancy_info(ctx: Context, tenancy_id: str) -> Dict[str, Any]:
        """
        Get detailed information about a tenancy.
    
        Args:
            tenancy_id: OCID of the tenancy
    
        Returns:
            Tenancy details including name, home region, and description
        """
        return get_tenancy_info(oci_clients["identity"], tenancy_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 states the tool retrieves information, implying it's a read-only operation, but doesn't specify authentication requirements, rate limits, error conditions, or what happens if the tenancy_id is invalid. This is a significant gap for a tool with no annotation coverage.

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 well-structured and front-loaded, with a clear purpose statement followed by specific sections for Args and Returns. Every sentence earns its place, providing essential information without redundancy or fluff.

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 simplicity (one parameter, no output schema, no annotations), the description is adequate but not complete. It explains the parameter and return values, but lacks behavioral details like error handling or authentication needs. For a read-only tool, this is minimally viable but leaves gaps in operational context.

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: 'tenancy_id: OCID of the tenancy.' This clarifies that it's an Oracle Cloud Identifier, which is crucial semantic information not evident from the schema alone (which has 0% description coverage). Since there's only one parameter, the description adequately compensates for the schema's lack of detail.

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 detailed information about a tenancy.' It specifies the verb ('Get') and resource ('tenancy'), making it easy to understand. However, it doesn't differentiate from sibling tools like 'get_user' or 'get_vcn' beyond the resource type, which prevents a perfect score.

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?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites, context, or comparisons to sibling tools (e.g., 'list_tenancies' if it existed), leaving the agent to infer usage based on the name alone.

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