In a saucepan, cook onion and garlic until onions are clear. Add tomato paste, and stir. Add in beans, and stir. Cook on medium-high heat until beans are heated through. Add in egg, and stir. Serve over rice.