Skip to main content
Glama

s3_list_objects

List and filter objects within an S3-compatible storage bucket to manage files and directories.

Instructions

List objects in an S3 bucket

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bucketYesThe name of the bucket
prefixNoOptional prefix to filter objects
maxKeysNoMaximum number of keys to return (default 1000)

Implementation Reference

  • Handler implementation for the s3_list_objects tool. Extracts bucket, optional prefix and maxKeys from arguments, sends ListObjectsV2Command to S3 client, maps response Contents to simplified file objects (key, size, lastModified), and returns as JSON text content.
    case "s3_list_objects": {
      const { bucket, prefix, maxKeys } = request.params.arguments as {
        bucket: string;
        prefix?: string;
        maxKeys?: number;
      };
      const command = new ListObjectsV2Command({
        Bucket: bucket,
        Prefix: prefix,
        MaxKeys: maxKeys,
      });
      const response = await s3Client.send(command);
      const files = (response.Contents || []).map((item) => ({
        key: item.Key,
        size: item.Size,
        lastModified: item.LastModified,
      }));
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(files, null, 2),
          },
        ],
      };
    }
  • Input schema definition for s3_list_objects tool, specifying required bucket and optional prefix/maxKeys.
    inputSchema: {
      type: "object",
      properties: {
        bucket: {
          type: "string",
          description: "The name of the bucket",
        },
        prefix: {
          type: "string",
          description: "Optional prefix to filter objects",
        },
        maxKeys: {
          type: "number",
          description: "Maximum number of keys to return (default 1000)",
        },
      },
      required: ["bucket"],
    },
  • src/index.ts:71-92 (registration)
    Registration of the s3_list_objects tool in the ListToolsRequestSchema handler, including name, description, and input schema.
    {
      name: "s3_list_objects",
      description: "List objects in an S3 bucket",
      inputSchema: {
        type: "object",
        properties: {
          bucket: {
            type: "string",
            description: "The name of the bucket",
          },
          prefix: {
            type: "string",
            description: "Optional prefix to filter objects",
          },
          maxKeys: {
            type: "number",
            description: "Maximum number of keys to return (default 1000)",
          },
        },
        required: ["bucket"],
      },
    },
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure but offers minimal information. It states the action but doesn't cover critical aspects like pagination behavior (implied by 'maxKeys'), rate limits, authentication requirements, or error handling. This leaves significant gaps for an agent to understand how the tool behaves in practice.

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 extremely concise—a single, direct sentence that states the tool's purpose without any fluff. It's front-loaded and wastes no words, making it easy to parse quickly.

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?

Given the complexity of an S3 listing operation (involving pagination, filtering, and potential large datasets), the description is incomplete. With no annotations and no output schema, it fails to address key behavioral traits (e.g., how results are structured, pagination details) or usage context. This leaves the agent under-informed for effective tool selection and invocation.

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 input schema fully documents all three parameters ('bucket', 'prefix', 'maxKeys') with clear descriptions. The description adds no additional parameter semantics beyond what's in the schema, which is acceptable given the high coverage, resulting in a baseline score of 3.

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 ('objects in an S3 bucket'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 's3_list_buckets' (which lists buckets rather than objects), leaving room for potential confusion about scope.

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. For example, it doesn't mention how it differs from 's3_read_object' (which retrieves specific object content) or 's3_list_buckets' (which lists buckets). The description lacks context about prerequisites or typical use cases.

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

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