Skip to main content
Glama
code-alchemist01

MCP Cloud Services Server

aws_list_s3_buckets

Retrieve a list of all S3 buckets in your AWS account to manage storage resources and monitor bucket inventory across regions.

Instructions

List all S3 buckets in AWS

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
regionNoAWS regionus-east-1

Implementation Reference

  • Tool-specific handler in handleAWSTool function that invokes the AWSAdapter to list S3 buckets and formats the response with total count and bucket details.
    case 'aws_list_s3_buckets': {
      const buckets = await adapter.listS3Buckets();
      return {
        total: buckets.length,
        buckets: buckets.map((bucket) => ({
          id: bucket.id,
          name: bucket.bucketName,
          region: bucket.region,
          creationDate: bucket.creationDate,
        })),
      };
    }
  • Core implementation in AWSAdapter that initializes S3 client, lists all buckets using AWS SDK, determines each bucket's region, and maps to standardized S3Bucket format.
    async listS3Buckets(): Promise<S3Bucket[]> {
      await this.initializeClients();
      if (!this.s3Client) throw new Error('S3 client not initialized');
    
      try {
        const command = new ListBucketsCommand({});
        const response = await this.s3Client.send(command);
    
        const buckets: S3Bucket[] = [];
    
        for (const bucket of response.Buckets || []) {
          // Get bucket location
          let location = this.region;
          try {
            const locationCommand = new GetBucketLocationCommand({ Bucket: bucket.Name });
            const locationResponse = await this.s3Client.send(locationCommand);
            location = locationResponse.LocationConstraint || this.region;
          } catch {
            // Use default region if location fetch fails
          }
    
          buckets.push({
            id: bucket.Name || '',
            type: 'storage',
            name: bucket.Name || '',
            region: location,
            status: 'running',
            bucketName: bucket.Name || '',
            creationDate: bucket.CreationDate,
          });
        }
    
        return buckets;
      } catch (error) {
        throw new Error(`Failed to list S3 buckets: ${error instanceof Error ? error.message : String(error)}`);
      }
    }
  • Input schema and metadata definition for the aws_list_s3_buckets tool, including optional region parameter.
    {
      name: 'aws_list_s3_buckets',
      description: 'List all S3 buckets in AWS',
      inputSchema: {
        type: 'object',
        properties: {
          region: {
            type: 'string',
            description: 'AWS region',
            default: 'us-east-1',
          },
        },
      },
    },
  • src/server.ts:19-27 (registration)
    Registers the aws_list_s3_buckets tool by including it in the awsTools array which is spread into the main allTools list exposed to the MCP server for tool listing.
    const allTools = [
      ...awsTools,
      ...azureTools,
      ...gcpTools,
      ...resourceManagementTools,
      ...costAnalysisTools,
      ...monitoringTools,
      ...securityTools,
    ];
  • src/server.ts:64-65 (registration)
    Routes execution of aws_list_s3_buckets and other AWS tools to the dedicated handleAWSTool function in the main tool call handler.
    if (awsTools.some((t) => t.name === name)) {
      result = await handleAWSTool(name, args || {});
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. While 'List' implies a read-only operation, the description doesn't mention authentication requirements, rate limits, pagination behavior, error conditions, or what format the results will be in. For a cloud API tool with zero annotation coverage, this is insufficient behavioral context.

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, efficient sentence that communicates the core purpose without any wasted words. It's appropriately sized for a simple listing tool and front-loads the essential information.

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 complexity of AWS API interactions and the complete lack of annotations and output schema, the description is inadequate. It doesn't explain what information is returned about each bucket, whether authentication is required, how errors are handled, or any operational constraints. For a cloud resource listing tool, this leaves significant gaps in understanding.

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 100%, so the schema already fully documents the single 'region' parameter with its type, description, and default value. The description doesn't add any parameter information beyond what's in the schema, meeting the baseline expectation when schema coverage is complete.

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') and resource ('all S3 buckets in AWS'), providing a specific verb+resource combination. However, it doesn't distinguish itself from sibling tools like 'list_resources' or 'gcp_list_storage_buckets' which might have overlapping functionality, preventing 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. With multiple sibling tools for listing resources across different cloud providers (AWS, Azure, GCP) and resource types, there's no indication of when this specific AWS S3 bucket listing tool is preferred over generic 'list_resources' or other cloud-specific listing tools.

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