Skip to main content
Glama

list-buckets

Retrieve a list of available S3 buckets using the S3 MCP Server, enabling LLMs to interact with AWS S3 storage for bucket management and data access.

Instructions

List available S3 buckets

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'list-buckets' tool. It invokes S3Resource.listBuckets() to retrieve the list of buckets, stringifies the result as JSON, and returns it as text content, or handles errors with createErrorResponse.
    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)}`, ); } }
  • Tool metadata including name 'list-buckets', description, and input parameters schema (empty object indicating no parameters required).
    readonly name = "list-buckets"; /** * Tool description */ readonly description = "List available S3 buckets"; /** * Parameter definition (empty for this tool) */ readonly parameters = {} as const;
  • src/server.ts:28-31 (registration)
    Registers all MCP tools, including 'list-buckets', on the McpServer instance using server.tool() with the tool's 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)); }
  • Factory function that instantiates the ListBucketsTool (for 'list-buckets') along with other tools, providing the shared S3Resource dependency.
    export function createTools(s3Resource: S3Resource): IMCPTool[] { return [ new ListBucketsTool(s3Resource), new ListObjectsTool(s3Resource), new GetObjectTool(s3Resource), ]; }

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

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