Skip to main content
Glama
KonMam

s3-mcp

by KonMam

download_file

Download objects from AWS S3 buckets to local files by specifying bucket name, object key, and destination filename.

Instructions

Downloads an object from an S3 bucket to a file.

Args: bucket (str): The name of the bucket to download from. key (str): The name of the key to download from. filename (str): The path to the file to download to.

Returns: str: JSON formatted success message.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bucketYes
keyYes
filenameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function for the 'download_file' tool, registered via @mcp.tool() decorator. It invokes the helper logic and formats the success response.
    @mcp.tool()
    def download_file(
        bucket: str,
        key: str,
        filename: str,
    ) -> str:
        """Downloads an object from an S3 bucket to a file.
    
        Args:
            bucket (str): The name of the bucket to download from.
            key (str): The name of the key to download from.
            filename (str): The path to the file to download to.
    
        Returns:
            str: JSON formatted success message.
        """
        _download_file_logic(bucket=bucket, key=key, filename=filename)
        return format_response(
            {"status": "success", "message": f"File '{key}' from bucket '{bucket}' downloaded to '{filename}'."}
        )
  • The supporting helper function containing the core download logic using boto3 S3 client's download_file method.
    def _download_file_logic(
        bucket: str,
        key: str,
        filename: str,
    ) -> None:
        """Core logic to download an object from an S3 bucket.
    
        Args:
            bucket (str): The S3 bucket name.
            key (str): The S3 object key.
            filename (str): The local path to download the file to.
        """
        client = get_s3_client()
        client.download_file(
            Bucket=bucket,
            Key=key,
            Filename=filename,
        )
  • Input schema defined by function parameters with type annotations: bucket (str), key (str), filename (str); returns str.
    def download_file(
        bucket: str,
        key: str,
        filename: str,
    ) -> str:
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 the action but doesn't mention permissions required (e.g., S3 read access), potential side effects (e.g., overwriting local files), error conditions (e.g., missing bucket/key), or performance aspects (e.g., file size limits). The return value is mentioned but lacks detail on error formats or success structure beyond 'JSON formatted success message'.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with a clear purpose statement followed by Args and Returns sections. It's front-loaded and wastes no words, though the 'Returns' section could be slightly more informative (e.g., noting what the JSON contains). Every sentence serves a purpose, making it efficient but not minimal.

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?

Given 3 parameters with 0% schema coverage and no annotations, the description adequately covers the basics but lacks depth for a file operation tool. It explains what the tool does and the parameters, but misses behavioral context (e.g., idempotency, error handling). The output schema exists, so describing return values isn't needed, but overall completeness is moderate due to the missing operational guidance.

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?

Schema description coverage is 0%, so the description must compensate. It explicitly defines all three parameters with clear semantics: 'bucket' as the source bucket name, 'key' as the object key, and 'filename' as the local destination path. This adds essential meaning beyond the bare schema, though it doesn't specify format details (e.g., path conventions or key patterns).

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 ('Downloads an object from an S3 bucket to a file') with the exact resource (S3 object). It distinguishes from siblings like 'get_object' (which might retrieve metadata) and 'upload_file' (which does the opposite). The verb+resource combination is precise and unambiguous.

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 'get_object' (which might return the object content differently) or 'copy_object' (which copies within S3). It mentions no prerequisites, exclusions, or contextual triggers, leaving the agent to infer usage from the tool name alone.

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