An embedding method is proposed, based upon Green-function matching, f
or calculating the electronic properties of an isolated adsorbate. The
self-consistent single-particle Schrodinger equation is solved in a l
ocalized region containing the adsorbate and that part of the substrat
e mainly perturbed by it. The extended substrate is taken into account
exactly by an effective embedding potential. The advantages of the me
thod for the adsorption problem are discussed and tested by a calculat
ion of the electronic properties of isolated Si and N adatoms on Al, m
odeled as jellium. In the former case excellent agreement is found wit
h the results previously computed by other methods, in the latter, not
previously investigated by a first-principles approach, the ioniclike
character of the bond is seen in the calculated charge densities and
densities of states. Finally the problem of the lack of screening due
to the presence of an adatom on a simple metal surface is estimated by
the generalized phase-shift theory. This effect turns out to be an im
portant contribution to the atom-surface interaction energies, and it
is corrected to first order by the use of the grand-canonical energy f
unctional.