Skip to main content
Glama

s3_read_object

Retrieve content from an S3-compatible storage bucket by specifying the bucket name and object key path.

Instructions

Read the content of an object from an S3 bucket

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bucketYesThe name of the bucket
keyYesThe key (path) of the object

Implementation Reference

  • The handler for the s3_read_object tool. Extracts bucket and key from arguments, sends GetObjectCommand to S3 client, converts response body stream to string using streamToString helper, and returns the content as text.
    case "s3_read_object": {
      const { bucket, key } = request.params.arguments as {
        bucket: string;
        key: string;
      };
      const command = new GetObjectCommand({
        Bucket: bucket,
        Key: key,
      });
      const response = await s3Client.send(command);
      const body = await streamToString(response.Body);
      return {
        content: [
          {
            type: "text",
            text: body,
          },
        ],
      };
    }
  • Input schema definition for s3_read_object tool, specifying bucket and key as required string parameters.
    inputSchema: {
      type: "object",
      properties: {
        bucket: {
          type: "string",
          description: "The name of the bucket",
        },
        key: {
          type: "string",
          description: "The key (path) of the object",
        },
      },
      required: ["bucket", "key"],
    },
  • src/index.ts:93-110 (registration)
    Registration of the s3_read_object tool in the listTools response, including name, description, and input schema.
    {
      name: "s3_read_object",
      description: "Read the content of an object from an S3 bucket",
      inputSchema: {
        type: "object",
        properties: {
          bucket: {
            type: "string",
            description: "The name of the bucket",
          },
          key: {
            type: "string",
            description: "The key (path) of the object",
          },
        },
        required: ["bucket", "key"],
      },
    },
  • Helper utility to convert S3 GetObject response stream to a string, specifically used in the s3_read_object handler.
    const streamToString = (stream: any): Promise<string> =>
      new Promise((resolve, reject) => {
        const chunks: any[] = [];
        stream.on("data", (chunk: any) => chunks.push(chunk));
        stream.on("error", reject);
        stream.on("end", () => resolve(Buffer.concat(chunks).toString("utf8")));
      });
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. It states this is a read operation, implying it's non-destructive, but doesn't mention authentication requirements, rate limits, error handling (e.g., for missing objects), or output format (e.g., binary vs. text). This leaves significant gaps for a tool that interacts with external storage.

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, clear sentence with zero wasted words. It's front-loaded with the core purpose and appropriately sized for a simple read operation, making it easy for an agent 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 interacting with S3 (an external service with potential authentication, errors, and data formats), the description is insufficient. With no annotations and no output schema, it fails to address critical aspects like return type (e.g., file content as bytes/string), error cases, or operational constraints, leaving the agent under-informed.

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 both parameters (bucket and key). The description doesn't add any meaning beyond what the schema provides—it doesn't explain what constitutes a valid bucket name or key format, nor does it provide examples. This meets the baseline 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 action ('Read the content') and target ('an object from an S3 bucket'), providing a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like s3_list_objects or s3_put_object, which prevents a perfect score.

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 like s3_list_objects (for listing objects) or s3_put_object (for writing). There's no mention of prerequisites, error conditions, or typical use cases, leaving the agent with minimal contextual direction.

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