Skip to main content
Glama

list-buckets

Retrieve a list of all available Amazon S3 buckets in your AWS account to manage storage resources and organize data.

Instructions

List available S3 buckets

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The `execute` method of `ListBucketsTool` that implements the core logic: lists S3 buckets via `s3Resource.listBuckets()`, formats as JSON, and handles errors.
    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)}`, ); } }
  • Defines the input parameters schema for the tool (empty object, no parameters required).
    readonly parameters = {} as const;
  • src/server.ts:28-31 (registration)
    Registers the `list-buckets` tool (among others) on the MCP server by calling `server.tool()` with name, description, parameters, and bound execute method.
    const tools = createTools(s3Resource); for (const tool of tools) { server.tool(tool.name, tool.description, tool.parameters, tool.execute.bind(tool)); }
  • Instantiates `ListBucketsTool` as part of `createTools()` function, which supplies the tool instance for registration.
    new ListBucketsTool(s3Resource), new ListObjectsTool(s3Resource), new GetObjectTool(s3Resource), ];
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