Skip to main content
Glama
KonMam

s3-mcp

by KonMam

copy_object

Copy files between S3 buckets or within the same bucket by specifying source and destination locations.

Instructions

Copies an object from one S3 location to another.

Args: source_bucket (str): The name of the source bucket. source_key (str): The key of the source object. destination_bucket (str): The name of the destination bucket. destination_key (str): The key of the destination object.

Returns: str: JSON formatted S3 response.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
source_bucketYes
source_keyYes
destination_bucketYes
destination_keyYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Main handler function for the 'copy_object' tool, decorated with @mcp.tool() for registration. Defines input schema via type hints and docstring, executes the tool by calling helper and formatting response.
    @mcp.tool()
    def copy_object(
        source_bucket: str,
        source_key: str,
        destination_bucket: str,
        destination_key: str,
    ) -> str:
        """Copies an object from one S3 location to another.
    
        Args:
            source_bucket (str): The name of the source bucket.
            source_key (str): The key of the source object.
            destination_bucket (str): The name of the destination bucket.
            destination_key (str): The key of the destination object.
    
        Returns:
            str: JSON formatted S3 response.
        """
        result = _copy_object_logic(
            source_bucket=source_bucket,
            source_key=source_key,
            destination_bucket=destination_bucket,
            destination_key=destination_key,
        )
        return format_response(result)
  • Helper function containing the core S3 copy_object logic using boto3 client.
    def _copy_object_logic(
        source_bucket: str,
        source_key: str,
        destination_bucket: str,
        destination_key: str,
    ) -> Dict[str, Any]:
        """Core logic to copy an object from one S3 location to another.
    
        Args:
            source_bucket (str): The name of the source bucket.
            source_key (str): The key of the source object.
            destination_bucket (str): The name of the destination bucket.
            destination_key (str): The key of the destination object.
    
        Returns:
            Dict[str, Any]: Raw boto3 response from copy_object.
        """
        client = get_s3_client()
        copy_source = {'Bucket': source_bucket, 'Key': source_key}
        return client.copy_object(
            CopySource=copy_source,
            Bucket=destination_bucket,
            Key=destination_key,
        )
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While 'Copies' implies a read+write operation, it doesn't specify whether this overwrites existing destination objects, requires specific IAM permissions, has size/time limits, or provides progress feedback. The return format is mentioned but not the content or error conditions.

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 perfectly structured with a clear purpose statement followed by well-organized Args and Returns sections. Every sentence adds value: the first explains what the tool does, the Args section documents all parameters, and the Returns section specifies the output format. No wasted words or redundancy.

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 4-parameter S3 operation with no annotations, the description covers the basic operation and parameters adequately. The presence of an output schema means the description doesn't need to detail return values. However, as a mutation tool with security implications, it should address permissions, error conditions, and behavioral specifics more thoroughly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description provides essential parameter documentation through the Args section, clearly defining all 4 parameters with their types and purposes. However, it doesn't explain S3 key format conventions, bucket naming rules, or path semantics that would help users construct valid parameters.

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 ('Copies') and resources involved ('object from one S3 location to another'), making the purpose immediately understandable. It distinguishes this tool from siblings like delete_object, get_object, and put_object by specifying it's a copy operation rather than deletion, retrieval, or creation.

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 like bucket permissions, whether the source must exist, or when to use copy_object versus download_file+upload_file combinations. There's no comparison to sibling tools like put_object for similar 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/KonMam/s3-mcp'

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