Skip to main content
Glama
KonMam

s3-mcp

by KonMam

download_file

Download objects from an S3 bucket to a specified file path. Requires bucket name, key, and filename inputs to retrieve and save the desired content.

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
filenameYes
keyYes

Implementation Reference

  • The primary handler for the download_file tool, registered via @mcp.tool() decorator. It invokes the helper function and returns a formatted success message.
    @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}'."} )
  • Supporting function that performs the actual S3 download using boto3 client.download_file.
    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, )

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