Skip to main content
Glama

get_bucket

Retrieve detailed information about an Oracle Cloud Infrastructure Object Storage bucket, including public access settings and versioning configuration.

Instructions

Get detailed information about a specific Object Storage bucket.

Args:
    bucket_name: Name of the bucket
    namespace: Optional namespace (if not provided, will be fetched automatically)

Returns:
    Detailed bucket information including public access settings and versioning

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bucket_nameYes
namespaceNo

Implementation Reference

  • MCP tool handler 'mcp_get_bucket' registered with @mcp.tool(name="get_bucket"). Fetches namespace if missing and delegates to core get_bucket helper with OCI client.
    @mcp.tool(name="get_bucket")
    @mcp_tool_wrapper(
        start_msg="Getting bucket details for {bucket_name}...",
        success_msg="Retrieved bucket details successfully",
        error_prefix="Error getting bucket details"
    )
    async def mcp_get_bucket(ctx: Context, bucket_name: str, namespace: Optional[str] = None) -> Dict[str, Any]:
        """
        Get detailed information about a specific Object Storage bucket.
    
        Args:
            bucket_name: Name of the bucket
            namespace: Optional namespace (if not provided, will be fetched automatically)
    
        Returns:
            Detailed bucket information including public access settings and versioning
        """
        # Get namespace if not provided
        if not namespace:
            namespace_info = get_namespace(oci_clients["object_storage"])
            namespace = namespace_info.get("namespace")
    
        return get_bucket(oci_clients["object_storage"], namespace, bucket_name)
  • Core helper function 'get_bucket' that executes the OCI API call to retrieve bucket details and formats the response as a dictionary.
    def get_bucket(object_storage_client: oci.object_storage.ObjectStorageClient, 
                   namespace_name: str, bucket_name: str) -> Dict[str, Any]:
        """
        Get details of a specific bucket.
        
        Args:
            object_storage_client: OCI ObjectStorage client
            namespace_name: Object Storage namespace name
            bucket_name: Name of the bucket
            
        Returns:
            Details of the bucket
        """
        try:
            bucket = object_storage_client.get_bucket(namespace_name, bucket_name).data
            
            bucket_details = {
                "name": bucket.name,
                "namespace": bucket.namespace,
                "compartment_id": bucket.compartment_id,
                "created_by": bucket.created_by,
                "time_created": str(bucket.time_created),
                "etag": bucket.etag,
                "public_access_type": bucket.public_access_type,
                "storage_tier": bucket.storage_tier,
                "object_events_enabled": bucket.object_events_enabled,
                "versioning": bucket.versioning,
                "replication_enabled": bucket.replication_enabled,
                "is_read_only": bucket.is_read_only,
                "object_lifecycle_policy_etag": bucket.object_lifecycle_policy_etag,
            }
            
            logger.info(f"Retrieved details for bucket {bucket_name}")
            return bucket_details
            
        except Exception as e:
            logger.exception(f"Error getting bucket details: {e}")
            raise
  • Import statement registering the get_bucket helper function from storage.py for use in the MCP tool wrappers.
    from mcp_server_oci.tools.storage import (
        list_buckets,
        get_bucket,
        list_volumes,
        get_volume,
        list_boot_volumes,
        get_boot_volume,
        list_file_systems,
        get_file_system,
    )
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool retrieves 'detailed information' and mentions return content like 'public access settings and versioning,' which adds some context. However, it lacks critical details: whether this is a read-only operation, potential error conditions (e.g., if the bucket doesn't exist), authentication requirements, or rate limits. This leaves significant gaps for a tool that likely interacts with cloud storage.

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 concise, with zero wasted words. It starts with a clear purpose statement, followed by bullet points for 'Args' and 'Returns' that efficiently organize key information. Every sentence earns its place, 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 moderate complexity (2 parameters, no output schema, no annotations), the description is partially complete. It covers the basic purpose and parameters adequately but lacks behavioral details like error handling or security requirements. Without an output schema, it helpfully hints at return values ('public access settings and versioning'), but this isn't comprehensive. It's a minimal viable description with clear room for improvement.

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 beyond the input schema, which has 0% description coverage. It explains that 'bucket_name' is the 'Name of the bucket' and clarifies that 'namespace' is 'Optional' and will be 'fetched automatically' if not provided. This compensates well for the schema's lack of descriptions, though it doesn't detail format constraints (e.g., naming rules for buckets).

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 Object Storage bucket.' It specifies the verb ('Get') and resource ('Object Storage bucket'), making the action unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'list_buckets' or other 'get_' tools, 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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'list_buckets' for listing multiple buckets or other 'get_' tools for different resources. There's no context about prerequisites, such as required permissions or when namespace specification is necessary, leaving usage unclear.

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