Skip to main content
Glama

get_database

Retrieve detailed Oracle Cloud Infrastructure database information including connection strings, character set, and PDB name by providing the database OCID.

Instructions

Get detailed information about a specific database.

Args:
    database_id: OCID of the database to retrieve

Returns:
    Detailed database information including connection strings, character set, and PDB name

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
database_idYes

Implementation Reference

  • MCP tool handler for 'get_database': registers the tool, wraps with error handling decorator, and delegates to helper function using global OCI database client.
    @mcp.tool(name="get_database")
    @mcp_tool_wrapper(
        start_msg="Getting database details for {database_id}...",
        success_msg="Retrieved database details successfully",
        error_prefix="Error getting database details"
    )
    async def mcp_get_database(ctx: Context, database_id: str) -> Dict[str, Any]:
        """
        Get detailed information about a specific database.
    
        Args:
            database_id: OCID of the database to retrieve
    
        Returns:
            Detailed database information including connection strings, character set, and PDB name
        """
        return get_database(oci_clients["database"], database_id)
  • Core helper function that performs the OCI DatabaseClient.get_database API call, extracts relevant fields, and returns formatted dictionary with database details.
    def get_database(database_client: oci.database.DatabaseClient, database_id: str) -> Dict[str, Any]:
        """
        Get details of a specific database.
        
        Args:
            database_client: OCI Database client
            database_id: OCID of the database
            
        Returns:
            Details of the database
        """
        try:
            database = database_client.get_database(database_id).data
            
            database_details = {
                "id": database.id,
                "db_name": database.db_name,
                "compartment_id": database.compartment_id,
                "character_set": database.character_set,
                "ncharacter_set": database.ncharacter_set,
                "db_workload": database.db_workload,
                "pdb_name": database.pdb_name,
                "lifecycle_state": database.lifecycle_state,
                "time_created": str(database.time_created),
                "db_unique_name": database.db_unique_name,
                "db_system_id": database.db_system_id,
                "vm_cluster_id": database.vm_cluster_id,
                "kms_key_id": database.kms_key_id,
                "vault_id": database.vault_id,
                "source_database_point_in_time_recovery_timestamp": str(database.source_database_point_in_time_recovery_timestamp) if database.source_database_point_in_time_recovery_timestamp else None,
            }
            
            logger.info(f"Retrieved details for database {database_id}")
            return database_details
            
        except Exception as e:
            logger.exception(f"Error getting database details: {e}")
            raise
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states this is a read operation ('Get'), which implies it's non-destructive, but doesn't disclose behavioral traits like authentication requirements, rate limits, error conditions, or what happens if the database_id is invalid. The description is minimal beyond stating the basic action.

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 the core purpose, followed by clear sections for Args and Returns. Every sentence earns its place with no wasted words, making it easy to scan and understand 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 low complexity (single parameter, no output schema, no annotations), the description is reasonably complete for a basic read operation. It explains what the tool does, the parameter, and the return information. However, it lacks details on behavioral aspects like error handling or authentication, which would be helpful given the absence of annotations.

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: 'database_id: OCID of the database to retrieve.' This clarifies that the ID is an OCID (Oracle Cloud Identifier) and its purpose, compensating for the 0% schema description coverage. Since there's only one parameter, the description adequately covers its semantics.

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 specific database.' It specifies the verb ('Get') and resource ('database'), though it doesn't explicitly differentiate from sibling tools like 'get_autonomous_database' or 'list_databases' beyond the singular vs. plural distinction.

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. While the description implies it's for retrieving details of a single database (vs. 'list_databases' for multiple), it doesn't explicitly state this or mention prerequisites like needing a database_id. The context is clear but lacks explicit usage rules.

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