s3_object_list
List all objects stored in an Amazon S3 bucket to manage and review file contents.
Instructions
List objects in an S3 bucket
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bucket_name | Yes | Name of the S3 bucket |
Implementation Reference
- src/mcp_server_aws/server.py:165-167 (handler)Core execution logic for the s3_object_list tool: calls boto3 S3 client's list_objects_v2 method with the bucket_name argument.elif name == "s3_object_list": response = s3_client.list_objects_v2( Bucket=arguments["bucket_name"])
- src/mcp_server_aws/tools.py:82-95 (schema)Tool definition including input schema that requires a 'bucket_name' string parameter.Tool( name="s3_object_list", description="List objects in an S3 bucket", inputSchema={ "type": "object", "properties": { "bucket_name": { "type": "string", "description": "Name of the S3 bucket" } }, "required": ["bucket_name"] } ),
- src/mcp_server_aws/server.py:135-139 (registration)Registers the s3_object_list tool (among others) by returning the list of AWS tools via MCP's list_tools handler.@server.list_tools() async def list_tools() -> list[Tool]: """List available AWS tools""" logger.debug("Handling list_tools request") return get_aws_tools()
- src/mcp_server_aws/server.py:178-180 (handler)Shared post-execution logic: logs the operation to audit and returns the S3 API response as formatted JSON text content.aws.log_operation("s3", name.replace("s3_", ""), arguments) return [TextContent(type="text", text=f"Operation Result:\n{json.dumps(response, indent=2, default=custom_json_serializer)}")]
- src/mcp_server_aws/tools.py:450-454 (registration)Combines S3 and DynamoDB tools (including s3_object_list from get_s3_tools) into the full tools list returned by list_tools.def get_aws_tools() -> list[Tool]: return [ *get_s3_tools(), *get_dynamodb_tools() ]