Skip to main content
Glama
code-alchemist01

MCP Cloud Services Server

gcp_list_storage_buckets

List all Cloud Storage buckets in a specified Google Cloud Platform project to manage and audit your object storage resources.

Instructions

List all Cloud Storage buckets in GCP

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdNoGCP project ID
regionNoGCP regionus-central1

Implementation Reference

  • Core handler logic that lists GCP Cloud Storage buckets using the @google-cloud/storage client, fetches metadata, and maps to GCPStorageBucket type.
    async listStorageBuckets(): Promise<GCPStorageBucket[]> {
      await this.initializeClients();
      if (!this.storage) throw new Error('Storage client not initialized');
    
      try {
        const [buckets] = await this.storage.getBuckets();
        const bucketList: GCPStorageBucket[] = [];
    
        for (const bucket of buckets) {
          const [metadata] = await bucket.getMetadata();
          bucketList.push({
            id: bucket.name,
            type: 'storage',
            name: bucket.name,
            projectId: this.projectId,
            location: metadata.location || this.region,
            status: 'running',
            bucketName: bucket.name,
            storageClass: metadata.storageClass,
            labels: metadata.labels ? Object.fromEntries(
              Object.entries(metadata.labels).map(([k, v]) => [k, v || ''])
            ) : undefined,
          });
        }
    
        return bucketList;
      } catch (error) {
        throw new Error(`Failed to list storage buckets: ${error instanceof Error ? error.message : String(error)}`);
      }
    }
  • Tool handler case in handleGCPTool that invokes GCPAdapter.listStorageBuckets() and formats the response.
    case 'gcp_list_storage_buckets': {
      const buckets = await adapter.listStorageBuckets();
      return {
        total: buckets.length,
        buckets: buckets.map((bucket) => ({
          id: bucket.id,
          name: bucket.bucketName,
          location: bucket.location,
          storageClass: bucket.storageClass,
        })),
      };
    }
  • Registers the gcp_list_storage_buckets tool in the gcpTools array, including name, description, and input schema.
    {
      name: 'gcp_list_storage_buckets',
      description: 'List all Cloud Storage buckets in GCP',
      inputSchema: {
        type: 'object',
        properties: {
          projectId: {
            type: 'string',
            description: 'GCP project ID',
          },
          region: {
            type: 'string',
            description: 'GCP region',
            default: 'us-central1',
          },
        },
      },
    },
  • Input schema definition for the tool, specifying projectId and optional region parameters.
    inputSchema: {
      type: 'object',
      properties: {
        projectId: {
          type: 'string',
          description: 'GCP project ID',
        },
        region: {
          type: 'string',
          description: 'GCP region',
          default: 'us-central1',
        },
      },
    },
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 action but lacks details on permissions required, rate limits, pagination, or response format. This is inadequate for a tool that interacts with cloud resources, leaving significant gaps in understanding its behavior.

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 a single, direct sentence that efficiently conveys the core purpose without unnecessary words. It is front-loaded and appropriately sized for a simple listing tool, making it highly concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is insufficiently complete. It does not address key contextual aspects like authentication needs, error handling, or what the output looks like (e.g., list format, metadata). For a cloud resource tool, this leaves too many unknowns for effective use.

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?

The input schema has 100% description coverage, documenting both parameters ('projectId' and 'region') with clear meanings. The description does not add any additional semantic context beyond what the schema provides, so it meets the baseline score of 3 for high schema 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 action ('List all') and resource ('Cloud Storage buckets in GCP'), making the purpose immediately understandable. However, it does not differentiate from sibling tools like 'list_resources' or 'aws_list_s3_buckets', which would require explicit comparison to achieve a score of 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, such as 'list_resources' for broader listing or 'aws_list_s3_buckets' for AWS-specific buckets. There is no mention of prerequisites, context, or exclusions, 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/code-alchemist01/Cloud-mcp_server'

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