Skip to main content
Glama

list_storage_buckets

Retrieve a list of Cloud Storage buckets within a specified GCP project by providing the project ID. This tool helps manage and organize storage resources efficiently.

Instructions

    List Cloud Storage buckets in a GCP project.
    
    Args:
        project_id: The ID of the GCP project to list buckets for
    
    Returns:
        List of Cloud Storage buckets in the specified GCP project
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYes

Implementation Reference

  • The handler function for the 'list_storage_buckets' tool, decorated with @mcp.tool(), which lists GCP Cloud Storage buckets for a given project using the google.cloud.storage client.
        @mcp.tool()
        def list_storage_buckets(project_id: str) -> str:
            """
            List Cloud Storage buckets in a GCP project.
            
            Args:
                project_id: The ID of the GCP project to list buckets for
            
            Returns:
                List of Cloud Storage buckets in the specified GCP project
            """
            try:
                from google.cloud import storage
                
                # Initialize the Storage client
                client = storage.Client(project=project_id)
                
                # List buckets
                buckets = client.list_buckets()
                
                # Format the response
                buckets_list = []
                for bucket in buckets:
                    location = bucket.location or "Unknown"
                    storage_class = bucket.storage_class or "Unknown"
                    created = bucket.time_created.strftime("%Y-%m-%d %H:%M:%S UTC") if bucket.time_created else "Unknown"
                    buckets_list.append(f"- {bucket.name} (Location: {location}, Class: {storage_class}, Created: {created})")
                
                if not buckets_list:
                    return f"No Cloud Storage buckets found in project {project_id}."
                
                buckets_str = "\n".join(buckets_list)
                
                return f"""
    Cloud Storage Buckets in GCP Project {project_id}:
    {buckets_str}
    """
            except Exception as e:
                return f"Error listing Cloud Storage buckets: {str(e)}"
  • Registration call for storage tools module, which includes the list_storage_buckets tool, invoked within the main register_tools function.
    # Register storage tools
    storage_tools.register_tools(mcp)
  • The register_tools function in the storage module where the list_storage_buckets tool is defined and registered via decorator when called.
    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?

With no annotations provided, the description carries full burden but lacks behavioral details. It mentions the action and return type but doesn't disclose permissions needed, rate limits, pagination, error handling, or whether it's read-only (implied but not stated). For a tool with zero annotation coverage, this is insufficient.

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 in the first sentence. The Args and Returns sections are clear and efficient, with no redundant information. Every sentence adds value without waste.

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 no annotations, no output schema, and low schema coverage, the description is minimally adequate. It covers the basic action and parameter but lacks details on behavior, output format, error cases, and integration context. For a simple list tool, it's passable but leaves gaps an agent might need.

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%, but the description adds the parameter 'project_id' with a brief explanation ('The ID of the GCP project to list buckets for'). This clarifies the parameter's purpose beyond the schema's title 'Project Id'. However, it doesn't provide format details, constraints, or examples, so it only partially compensates for the low coverage.

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 verb ('List') and resource ('Cloud Storage buckets in a GCP project'), making the purpose unambiguous. It distinguishes from siblings like 'list_objects' or 'list_gcp_projects' by specifying storage buckets. However, it doesn't explicitly differentiate from all list tools, so it's not a perfect 5.

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 prerequisites (e.g., authentication), compare to other listing tools (like 'list_assets' or 'list_gcp_projects'), or specify use cases. The agent must infer usage from the 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