get_file_system
Retrieve detailed information about an Oracle Cloud Infrastructure File Storage file system, including metered bytes and snapshots, by providing its OCID.
Instructions
Get detailed information about a specific File Storage file system.
Args:
file_system_id: OCID of the file system to retrieve
Returns:
Detailed file system information including metered bytes and snapshots
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_system_id | Yes |
Implementation Reference
- mcp_server_oci/mcp_server.py:959-975 (handler)MCP tool handler function 'mcp_get_file_system' that implements the 'get_file_system' tool logic by calling the helper function with the file storage client and file_system_id.@mcp.tool(name="get_file_system") @mcp_tool_wrapper( start_msg="Getting file system details for {file_system_id}...", success_msg="Retrieved file system details successfully", error_prefix="Error getting file system details" ) async def mcp_get_file_system(ctx: Context, file_system_id: str) -> Dict[str, Any]: """ Get detailed information about a specific File Storage file system. Args: file_system_id: OCID of the file system to retrieve Returns: Detailed file system information including metered bytes and snapshots """ return get_file_system(oci_clients["file_storage"], file_system_id)
- Helper function that performs the actual OCI API call to retrieve file system details using the FileStorageClient.def get_file_system(file_storage_client: oci.file_storage.FileStorageClient, file_system_id: str) -> Dict[str, Any]: """ Get details of a specific file system. Args: file_storage_client: OCI FileStorage client file_system_id: OCID of the file system Returns: Details of the file system """ try: file_system = file_storage_client.get_file_system(file_system_id).data file_system_details = { "id": file_system.id, "display_name": file_system.display_name, "compartment_id": file_system.compartment_id, "availability_domain": file_system.availability_domain, "lifecycle_state": file_system.lifecycle_state, "time_created": str(file_system.time_created), "metered_bytes": file_system.metered_bytes, "is_clone_parent": file_system.is_clone_parent, "is_hydrated": file_system.is_hydrated, "lifecycle_details": file_system.lifecycle_details, "kms_key_id": file_system.kms_key_id, "source_details": { "parent_file_system_id": file_system.source_details.parent_file_system_id if file_system.source_details else None, "source_snapshot_id": file_system.source_details.source_snapshot_id if file_system.source_details else None, } if file_system.source_details else None, } logger.info(f"Retrieved details for file system {file_system_id}") return file_system_details except Exception as e: logger.exception(f"Error getting file system details: {e}") raise