Skip to main content
Glama

list-s3-buckets

Retrieve all S3 buckets in your AWS account to manage storage, monitor resources, and organize data across regions.

Instructions

List all S3 buckets in your AWS account

Input Schema

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

Implementation Reference

  • Handler logic for the 'list-s3-buckets' tool within the handle_call_tool function. It uses boto3 to create an S3 client, list all buckets, format them into a text response, or return an error message if a ClientError occurs.
    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)}"
                )
            ]
  • Registration of the 'list-s3-buckets' tool in the handle_list_tools function, including its name, description, and JSON schema for input validation (region parameter).
        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)",
                    }
                }
            },
        )
    ]
  • JSON schema definition for the 'list-s3-buckets' tool input, defining an optional 'region' string parameter.
    inputSchema={
        "type": "object",
        "properties": {
            "region": {
                "type": "string",
                "description": "AWS region (optional, defaults to configured region)",
            }
        }
    },
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions 'all S3 buckets' which implies completeness, but doesn't address permissions needed, rate limits, pagination, error conditions, or what the output looks like. For a tool with zero annotation coverage, this is inadequate.

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 with zero wasted words. It's appropriately sized for a simple list operation and front-loads the core functionality.

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?

For a tool with no annotations, no output schema, and minimal behavioral disclosure, the description is incomplete. It should address authentication requirements, output format, and potential limitations given this is an AWS operation that could have permission constraints.

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 documents the single optional 'region' parameter. The description doesn't add any parameter-specific information beyond what's in the schema. Baseline 3 is appropriate when schema does the heavy lifting.

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 your AWS account'), providing a specific verb+resource combination. It doesn't need to distinguish from siblings since none exist, so it earns a 4 rather than 5.

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, prerequisites, or contextual constraints. It simply states what the tool does without any usage instructions.

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

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