Skip to main content
Glama

list_autonomous_databases

Retrieve Autonomous Databases in a specified OCI compartment to view configurations, workload types, and connection details for management.

Instructions

List all Autonomous Databases in a compartment.

Args:
    compartment_id: OCID of the compartment to list Autonomous Databases from

Returns:
    List of Autonomous Databases with their configuration, workload type, and connection info

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
compartment_idYes

Implementation Reference

  • Core implementation of the list_autonomous_databases tool handler. Uses OCI DatabaseClient to fetch and paginate autonomous databases, extracts relevant fields into structured dicts, and handles errors.
    def list_autonomous_databases(database_client: oci.database.DatabaseClient, compartment_id: str) -> List[Dict[str, Any]]:
        """
        List all autonomous databases in a compartment.
        
        Args:
            database_client: OCI Database client
            compartment_id: OCID of the compartment
            
        Returns:
            List of autonomous databases with their details
        """
        try:
            autonomous_databases_response = oci.pagination.list_call_get_all_results(
                database_client.list_autonomous_databases,
                compartment_id
            )
            
            autonomous_databases = []
            for adb in autonomous_databases_response.data:
                autonomous_databases.append({
                    "id": adb.id,
                    "db_name": adb.db_name,
                    "display_name": adb.display_name,
                    "compartment_id": adb.compartment_id,
                    "lifecycle_state": adb.lifecycle_state,
                    "time_created": str(adb.time_created),
                    "cpu_core_count": adb.cpu_core_count,
                    "data_storage_size_in_tbs": adb.data_storage_size_in_tbs,
                    "is_free_tier": adb.is_free_tier,
                    "is_auto_scaling_enabled": adb.is_auto_scaling_enabled,
                    "db_workload": adb.db_workload,
                    "db_version": adb.db_version,
                    "license_model": adb.license_model,
                    "is_dedicated": adb.is_dedicated,
                    "autonomous_container_database_id": adb.autonomous_container_database_id,
                    "is_access_control_enabled": adb.is_access_control_enabled,
                    "whitelisted_ips": adb.whitelisted_ips,
                    "are_primary_whitelisted_ips_used": adb.are_primary_whitelisted_ips_used,
                    "standby_whitelisted_ips": adb.standby_whitelisted_ips,
                    "is_data_guard_enabled": adb.is_data_guard_enabled,
                    "is_local_data_guard_enabled": adb.is_local_data_guard_enabled,
                    "subnet_id": adb.subnet_id,
                    "nsg_ids": adb.nsg_ids,
                    "private_endpoint": adb.private_endpoint,
                    "private_endpoint_label": adb.private_endpoint_label,
                })
            
            logger.info(f"Found {len(autonomous_databases)} autonomous databases in compartment {compartment_id}")
            return autonomous_databases
            
        except Exception as e:
            logger.exception(f"Error listing autonomous databases: {e}")
            raise
  • MCP tool registration and wrapper handler for 'list_autonomous_databases'. Registers the tool with FastMCP, applies common error handling wrapper, and delegates to the core handler function with the OCI database client.
    @mcp.tool(name="list_autonomous_databases")
    @mcp_tool_wrapper(
        start_msg="Listing Autonomous Databases in compartment {compartment_id}...",
        error_prefix="Error listing Autonomous Databases"
    )
    async def mcp_list_autonomous_databases(ctx: Context, compartment_id: str) -> List[Dict[str, Any]]:
        """
        List all Autonomous Databases in a compartment.
    
        Args:
            compartment_id: OCID of the compartment to list Autonomous Databases from
    
        Returns:
            List of Autonomous Databases with their configuration, workload type, and connection info
        """
        return list_autonomous_databases(oci_clients["database"], compartment_id)
  • Import of the list_autonomous_databases helper function from tools/database.py into the main server module.
    from mcp_server_oci.tools.database import (
        list_db_systems as list_db_systems_dbpkg,  # alias to avoid name clash
        get_db_system as get_db_system_dbpkg,
        list_databases,
        get_database,
        list_autonomous_databases,
        get_autonomous_database,
    )
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. While it states the tool lists databases and describes the return content (configuration, workload type, connection info), it lacks critical behavioral details such as pagination behavior, rate limits, authentication requirements, error conditions, or whether the operation is read-only (implied but not stated). For a list operation with zero annotation coverage, this is 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 adds value: the first sentence states the core functionality, the second explains the parameter, and the third describes the return content. There's no redundant or wasted text, making it easy to parse quickly.

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 operation with one parameter) and lack of annotations and output schema, the description provides basic completeness: it states what the tool does, explains the parameter, and outlines return content. However, it lacks important contextual details like pagination, sorting/filtering options, error handling, or performance characteristics that would be helpful for an AI agent. The absence of an output schema means the description should ideally provide more detail about the return structure.

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 'compartment_id' by explaining it's the 'OCID of the compartment to list Autonomous Databases from.' This clarifies the parameter's purpose beyond what the schema provides (which has 0% description coverage, only showing 'Compartment Id' as title). Since there's only one parameter and the description fully explains it, this compensates well 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: 'List all Autonomous Databases in a compartment.' It specifies the verb ('List') and resource ('Autonomous Databases'), and distinguishes it from sibling tools like 'get_autonomous_database' (singular retrieval) and 'list_databases' (different resource type). However, it doesn't explicitly differentiate from other list tools beyond the resource name.

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 context by specifying 'in a compartment' and listing the required 'compartment_id' parameter, which suggests this tool is for compartment-scoped listing. However, it doesn't provide explicit guidance on when to use this tool versus alternatives like 'get_autonomous_database' for single database retrieval or other list tools for different resources. No exclusions or prerequisites are mentioned.

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