The adsorption of individual atoms on the semiconducting and metallic single-walled carbon nanotubes (SWNT) has been investigated by using the first principles pseudopotential plane wave method within density functional theory. The stable adsorption geometries and binding energies have been determined for a large number of foreign atoms ranging from alkali and simple metals to the transition metals and group IV elements. We have found that the character of the bonding and associated physical properties strongly depends on the type of adsorbed atoms, in particular, on their valence electron structure. Our results indicate that the properties of SWNTs can be modified by the adsorbed foreign atoms. Although the atoms of good conducting metals, such as Zn, Cu, Ag, and Au, form very weak bonds, transition-metal atoms such as Ti, Sc, Nb, and Ta and group IV elements C and Si are adsorbed with a relatively high binding energy. Owing to the curvature effect, these binding energies are larger than the binding energies of the same atoms on the graphite surface. We have showed that the adatom carbon can form strong and directional bonds between two SWNTs. These connects can be used to produce nanotube networks or grids. Most of the adsorbed transition-metal atoms excluding Ni, Pd, and Pt have a magnetic ground state with a significant magnetic moment. Our results suggest that carbon nanotubes can be functionalized in different ways by their coverage with different atoms, showing interesting applications such as 1D nanomagnets or nanoconductors, conducting connects, and so forth.