Skip to main content
Glama

s3_delete_object

Remove objects from S3-compatible storage buckets to manage storage space and maintain data organization.

Instructions

Delete 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 logic for the s3_delete_object tool. It extracts the bucket and key from the request arguments, creates a DeleteObjectCommand, sends it to the S3 client, and returns a success message.
    case "s3_delete_object": {
      const { bucket, key } = request.params.arguments as {
        bucket: string;
        key: string;
      };
      const command = new DeleteObjectCommand({
        Bucket: bucket,
        Key: key,
      });
      await s3Client.send(command);
      return {
        content: [
          {
            type: "text",
            text: `Successfully deleted ${bucket}/${key}`,
          },
        ],
      };
    }
  • The tool definition including name, description, and input schema for s3_delete_object, registered in the ListTools response.
    {
      name: "s3_delete_object",
      description: "Delete 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"],
      },
    },
  • src/index.ts:60-153 (registration)
    The ListTools request handler where the s3_delete_object tool is registered by including it in the tools list.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: [
          {
            name: "s3_list_buckets",
            description: "List all S3 buckets",
            inputSchema: {
              type: "object",
              properties: {},
            },
          },
          {
            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"],
            },
          },
          {
            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"],
            },
          },
          {
            name: "s3_put_object",
            description: "Upload an object to 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",
                },
                content: {
                  type: "string",
                  description: "The content to upload",
                },
              },
              required: ["bucket", "key", "content"],
            },
          },
          {
            name: "s3_delete_object",
            description: "Delete 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"],
            },
          },
        ],
      };
    });
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool deletes an object, implying a destructive mutation, but doesn't mention critical behaviors like irreversibility, error handling (e.g., if the object doesn't exist), permissions required, or rate limits. This leaves significant gaps for a destructive operation.

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 waste. It's front-loaded with the core action and resource, making it easy to parse quickly. Every word earns its place without redundancy or fluff.

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 tool's complexity (destructive operation with no annotations and no output schema), the description is incomplete. It lacks details on behavioral traits (e.g., permanence, auth needs), error responses, or output expectations. For a delete tool, this leaves the agent under-informed about critical operational aspects.

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%, with both parameters (bucket and key) clearly documented in the schema. The description adds no additional meaning beyond what the schema provides—it doesn't explain parameter formats, constraints, or examples. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Delete') and resource ('an object from an S3 bucket'), distinguishing it from sibling tools like s3_list_objects (list), s3_put_object (create/update), and s3_read_object (read). It uses precise language that leaves no ambiguity about the tool's function.

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. It doesn't mention prerequisites (e.g., needing appropriate permissions), exclusions (e.g., not for deleting buckets), or comparisons to siblings like s3_put_object for updates. Usage is implied but not explicitly defined.

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