get_vault
Retrieve detailed information about a specific Oracle Cloud Infrastructure KMS vault, including crypto and management endpoints, by providing its OCID.
Instructions
Get detailed information about a specific KMS vault.
Args:
vault_id: OCID of the vault to retrieve
Returns:
Detailed vault information including crypto and management endpoints
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| vault_id | Yes |
Implementation Reference
- mcp_server_oci/mcp_server.py:1432-1449 (handler)The primary handler function for the 'get_vault' MCP tool. It wraps the security helper with error handling, logging, and profile checks, then calls get_vault with the KmsVaultClient.@mcp.tool(name="get_vault") @mcp_tool_wrapper( start_msg="Getting vault details for {vault_id}...", success_msg="Retrieved vault details successfully", error_prefix="Error getting vault details" ) async def mcp_get_vault(ctx: Context, vault_id: str) -> Dict[str, Any]: """ Get detailed information about a specific KMS vault. Args: vault_id: OCID of the vault to retrieve Returns: Detailed vault information including crypto and management endpoints """ return get_vault(oci_clients["kms_vault"], vault_id)
- mcp_server_oci/mcp_server.py:1432-1432 (registration)MCP tool registration decorator specifying the tool name 'get_vault'.@mcp.tool(name="get_vault")
- Helper function that performs the actual OCI API call to retrieve vault details using KmsVaultClient.get_vault and formats the response.def get_vault(kms_vault_client: oci.key_management.KmsVaultClient, vault_id: str) -> Dict[str, Any]: """ Get details of a specific vault. Args: kms_vault_client: OCI KmsVault client vault_id: OCID of the vault Returns: Details of the vault """ try: vault = kms_vault_client.get_vault(vault_id).data vault_details = { "id": vault.id, "display_name": vault.display_name, "compartment_id": vault.compartment_id, "lifecycle_state": vault.lifecycle_state, "time_created": str(vault.time_created), "vault_type": vault.vault_type, "crypto_endpoint": vault.crypto_endpoint, "management_endpoint": vault.management_endpoint, "is_primary": vault.is_primary, "replica_details": { "replication_id": vault.replica_details.replication_id if vault.replica_details else None, } if vault.replica_details else None, } logger.info(f"Retrieved details for vault {vault_id}") return vault_details except Exception as e: logger.exception(f"Error getting vault details: {e}") raise