Skip to main content
Glama

list-buckets

List all S3 buckets in your AWS account. Get a complete inventory of bucket names for storage management and organization.

Instructions

List available S3 buckets

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The execute() method that runs when 'list-buckets' is invoked. It calls s3Resource.listBuckets() and returns the result as JSON text.
    async execute(_args: Record<string, never>) {
      try {
        const buckets = await this.s3Resource.listBuckets();
        return {
          content: [
            {
              type: "text" as const,
              text: JSON.stringify(buckets, null, 2),
            },
          ],
        };
      } catch (error) {
        return createErrorResponse(
          error,
          `Error listing buckets: ${error instanceof Error ? error.message : String(error)}`,
        );
      }
    }
  • Empty parameters definition (const assertion) since list-buckets takes no arguments.
    readonly parameters = {} as const;
  • src/server.ts:28-30 (registration)
    Tools are registered via server.tool() in the createServer() function, iterating over all tools including ListBucketsTool.
    const tools = createTools(s3Resource);
    for (const tool of tools) {
      server.tool(tool.name, tool.description, tool.parameters, tool.execute.bind(tool));
  • The S3Resource.listBuckets() method that actually calls AWS SDK's ListBucketsCommand and optionally filters by configured buckets.
    async listBuckets(): Promise<Bucket[]> {
      try {
        const command = new ListBucketsCommand({});
        const response = await this.client.send(command);
    
        const buckets = response.Buckets || [];
    
        // Use pattern matching to filter buckets
        return match({ buckets, hasConfiguredBuckets: this.configuredBuckets.length > 0 })
          .with({ hasConfiguredBuckets: true }, ({ buckets }) =>
            buckets
              .filter((bucket) => bucket.Name && this.configuredBuckets.includes(bucket.Name))
              .slice(0, this.maxBuckets),
          )
          .otherwise(({ buckets }) => buckets.slice(0, this.maxBuckets));
      } catch (error) {
        this.logError("Error listing buckets:", error);
        throw error;
      }
    }
  • The createTools() factory function instantiates ListBucketsTool with the S3Resource dependency.
    export function createTools(s3Resource: S3Resource): IMCPTool[] {
      return [
        new ListBucketsTool(s3Resource),
        new ListObjectsTool(s3Resource),
        new GetObjectTool(s3Resource),
      ];
    }
Behavior2/5

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

With no annotations, the description must disclose behavioral traits, but it only states 'List available S3 buckets' without mentioning any side effects, authorization, format, or limits. This is minimal transparency.

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?

A single, front-loaded sentence with no wasted words. Every part is essential.

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

Completeness4/5

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

Given the tool's simplicity (no parameters, no output schema), the description adequately explains its purpose. It could mention the return format, but not strictly necessary.

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 tool has zero parameters, so the description does not need to add param info. The baseline is 4, and the description's mention of 'available' adds slight context.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb 'list' and resource 'S3 buckets', clearly distinguishing it from sibling tools like get-object and list-objects.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

While no explicit when/when-not guidance is given, the context is clear: use this when you need to list available S3 buckets. Alternatives are not needed since siblings cover different resources.

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/samuraikun/aws-s3-mcp'

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