Skip to main content
Glama

list_s3_buckets

Retrieve all S3 buckets in your AWS account and optionally check for public access configurations to manage storage security.

Instructions

Lists all S3 buckets in the AWS account.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
check_public_accessNoIf true, checks if buckets have public access enabled.

Implementation Reference

  • Implementation of the list_s3_buckets tool handler. Uses S3Client to send ListBucketsCommand to list all buckets. Optionally, if check_public_access is true, checks each bucket's policy status using GetBucketPolicyStatusCommand to determine if public access is enabled.
    if (name === "list_s3_buckets") {
        const command = new ListBucketsCommand({});
        const response = await s3Client.send(command);
    
        let buckets = response.Buckets?.map((b) => ({
            Name: b.Name,
            CreationDate: b.CreationDate,
            IsPublic: undefined as boolean | undefined
        })) || [];
    
        if (args && (args as any).check_public_access) {
            buckets = await Promise.all(buckets.map(async (b) => {
                try {
                    if (!b.Name) return b;
                    const policyCmd = new GetBucketPolicyStatusCommand({ Bucket: b.Name });
                    const policyResponse = await s3Client.send(policyCmd);
                    return { ...b, IsPublic: policyResponse.PolicyStatus?.IsPublic || false };
                } catch (error) {
                    // If checks fail (e.g. AccessDenied or no policy context), assume not public or unknown
                    return { ...b, IsPublic: false };
                }
            }));
        }
    
        return {
            content: [
                {
                    type: "text",
                    text: JSON.stringify(buckets, null, 2),
                },
            ],
        };
    }
  • src/index.ts:105-117 (registration)
    Registration of the list_s3_buckets tool in the list of available tools returned by ListToolsRequestHandler, including name, description, and input schema.
    {
        name: "list_s3_buckets",
        description: "Lists all S3 buckets in the AWS account.",
        inputSchema: {
            type: "object",
            properties: {
                check_public_access: {
                    type: "boolean",
                    description: "If true, checks if buckets have public access enabled."
                }
            },
        },
    },
  • Input schema definition for the list_s3_buckets tool, defining optional check_public_access parameter.
    inputSchema: {
        type: "object",
        properties: {
            check_public_access: {
                type: "boolean",
                description: "If true, checks if buckets have public access enabled."
            }
        },
    },
Behavior2/5

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

With no annotations provided, the description carries full burden but only states the basic operation. It doesn't disclose behavioral traits like whether this requires specific IAM permissions, if it's paginated, rate limits, what format the output takes, or whether it's a read-only operation (though implied by 'Lists').

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 that states exactly what the tool does with zero wasted words. It's appropriately sized for a simple listing 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.

Completeness3/5

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

For a simple listing tool with one well-documented parameter but no annotations or output schema, the description provides the minimum viable information. However, it lacks context about permissions, output format, and operational constraints that would be helpful given the AWS context.

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 fully documents the single parameter. The description doesn't add any parameter-specific context beyond what's in the schema, maintaining the baseline score for high schema coverage.

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 verb ('Lists') and resource ('all S3 buckets in the AWS account'), making the purpose immediately understandable. It distinguishes from siblings by specifying S3 buckets, though it doesn't explicitly differentiate from other list_* tools beyond the resource type.

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?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites, permissions needed, or contextual triggers for selecting this tool over other AWS listing operations.

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/bhaveshopss/MCP-server'

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