If the wall is a segmental retaining wall built with interlocking block and no mortar or a concrete footing, use some globs of silicone to allow for seasonal movement.
If it is a rigid retaining wall built with mortar and a concrete footing, use caps attached with conventional mortar.
Dick