Skip to main content
Glama

list-s3-buckets

Retrieve a comprehensive list of all S3 buckets in your AWS account. Specify the region or use the default to streamline bucket management and access.

Instructions

List all S3 buckets in your AWS account

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
regionNoAWS region (optional, defaults to configured region)

Implementation Reference

  • Executes the list-s3-buckets tool by creating an S3 client with optional region, listing all buckets, and returning a formatted text list or error message.
    if name == "list-s3-buckets": try: region = arguments.get("region") if arguments else None s3_client = boto3.client('s3', region_name=region) if region else boto3.client('s3') response = s3_client.list_buckets() buckets = [bucket['Name'] for bucket in response['Buckets']] return [ types.TextContent( type="text", text=f"Found {len(buckets)} S3 buckets:\n" + "\n".join(f"- {bucket}" for bucket in buckets) ) ] except ClientError as e: return [ types.TextContent( type="text", text=f"Error listing S3 buckets: {str(e)}" ) ]
  • JSON schema defining the input parameters for the list-s3-buckets tool, including an optional 'region' string.
    inputSchema={ "type": "object", "properties": { "region": { "type": "string", "description": "AWS region (optional, defaults to configured region)", } } },
  • Registers the list-s3-buckets tool in the handle_list_tools() response, providing name, description, and input schema.
    types.Tool( name="list-s3-buckets", description="List all S3 buckets in your AWS account", inputSchema={ "type": "object", "properties": { "region": { "type": "string", "description": "AWS region (optional, defaults to configured region)", } } }, )

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/sofianhamiti/mcp-server-s3'

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