Skip to main content
Glama

get_bucket_details

Retrieve detailed information about a specific Cloud Storage bucket in Google Cloud Platform by providing the project ID and bucket name.

Instructions

    Get detailed information about a specific Cloud Storage bucket.
    
    Args:
        project_id: The ID of the GCP project
        bucket_name: The name of the bucket to get details for
    
    Returns:
        Detailed information about the specified Cloud Storage bucket
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bucket_nameYes
project_idYes

Implementation Reference

  • The handler function for the 'get_bucket_details' tool. It uses the Google Cloud Storage client to retrieve bucket details including name, location, storage class, creation time, versioning, labels, and more, then formats them into a string response.
        @mcp.tool()
        def get_bucket_details(project_id: str, bucket_name: str) -> str:
            """
            Get detailed information about a specific Cloud Storage bucket.
            
            Args:
                project_id: The ID of the GCP project
                bucket_name: The name of the bucket to get details for
            
            Returns:
                Detailed information about the specified Cloud Storage bucket
            """
            try:
                from google.cloud import storage
                
                # Initialize the Storage client
                client = storage.Client(project=project_id)
                
                # Get the bucket
                bucket = client.get_bucket(bucket_name)
                
                # Format the response
                details = []
                details.append(f"Name: {bucket.name}")
                details.append(f"Project: {project_id}")
                details.append(f"Location: {bucket.location or 'Unknown'}")
                details.append(f"Storage Class: {bucket.storage_class or 'Unknown'}")
                details.append(f"Created: {bucket.time_created.strftime('%Y-%m-%d %H:%M:%S UTC') if bucket.time_created else 'Unknown'}")
                details.append(f"Versioning Enabled: {bucket.versioning_enabled}")
                details.append(f"Requester Pays: {bucket.requester_pays}")
                details.append(f"Lifecycle Rules: {len(bucket.lifecycle_rules) if bucket.lifecycle_rules else 0} rules defined")
                details.append(f"Labels: {bucket.labels or 'None'}")
                details.append(f"CORS: {bucket.cors or 'None'}")
                
                details_str = "\n".join(details)
                
                return f"""
    Cloud Storage Bucket Details:
    {details_str}
    """
            except Exception as e:
                return f"Error getting bucket details: {str(e)}"
  • Top-level registration call for all storage tools, including 'get_bucket_details', by invoking the register_tools function from the storage module.
    storage_tools.register_tools(mcp)
  • The register_tools function in the storage module that defines and registers the 'get_bucket_details' tool using @mcp.tool() decorator.
    def register_tools(mcp):
        """Register all storage tools with the MCP server."""
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. It states the tool retrieves information (implying read-only), but doesn't specify authentication requirements, rate limits, error conditions, or what 'detailed information' includes (e.g., metadata, configuration, IAM policies). For a cloud resource tool with zero annotation coverage, this leaves significant gaps in understanding its operational behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (purpose, Args, Returns) and uses minimal sentences. Each sentence earns its place by defining the tool's function and parameters. It could be slightly more concise by integrating the purpose with the Args section, but overall it's efficient and front-loaded with the core purpose.

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 required parameters, no output schema, no annotations), the description is minimally complete. It covers the basic purpose and parameters but lacks details on authentication, error handling, return format, or integration with sibling tools. For a cloud storage tool in a server with many siblings, more contextual guidance would be beneficial, but it meets the minimum viable threshold.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the schema provides no parameter documentation. The description adds basic semantics by naming and briefly describing both parameters ('project_id: The ID of the GCP project', 'bucket_name: The name of the bucket to get details for'), which compensates partially. However, it doesn't provide format examples, constraints, or relationship between parameters, keeping it at a baseline adequate level.

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 with a specific verb ('Get detailed information') and resource ('Cloud Storage bucket'). It distinguishes from sibling tools like 'list_storage_buckets' by focusing on a single bucket rather than listing multiple. However, it doesn't explicitly contrast with 'get_gcp_project_details' or other 'get_*' tools, which would require more explicit differentiation for 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 when to choose this over 'list_storage_buckets' for overviews or other 'get_*' tools for different resource types. There are no prerequisites, exclusions, or contextual hints provided, leaving the agent to infer usage based on the tool name alone.

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

Related 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/henihaddad/gcp-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server