Skip to main content
Glama
KonMam

s3-mcp

by KonMam

delete_object

Remove specific objects from an S3 bucket by specifying bucket name and object key. Returns S3 response in JSON format for tracking deletion status.

Instructions

Deletes an object from an S3 bucket.

Args: bucket (str): The name of the bucket. key (str): The key (name) of the object.

Returns: str: JSON formatted S3 response.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bucketYes
keyYes

Implementation Reference

  • The main handler function for the 'delete_object' tool, decorated with @mcp.tool() for registration. It calls the helper logic and formats the response.
    @mcp.tool() def delete_object(bucket: str, key: str) -> str: """Deletes an object from an S3 bucket. Args: bucket (str): The name of the bucket. key (str): The key (name) of the object. Returns: str: JSON formatted S3 response. """ result = _delete_object_logic(bucket=bucket, key=key) return format_response(result)
  • The core helper function that performs the actual S3 delete_object operation using boto3 client.
    def _delete_object_logic(bucket: str, key: str) -> Dict[str, Any]: """Core logic to delete an object from an S3 bucket. Args: bucket (str): The S3 bucket name. key (str): The S3 object key. Returns: Dict[str, Any]: Raw boto3 response from delete_object. """ client = get_s3_client() return client.delete_object(Bucket=bucket, Key=key)

Other Tools

Related 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/KonMam/s3-mcp'

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