Many glues form bonds that are stronger than wood, so simply trying to scrape it up will probably damage the wood itself. Ideally, you would be able to get the carpet off the stairs without damaging the wood, then deal with the glue by itself. Essentialy, you want to find the right product to break the glue down, without damaging the wood. Without knowing what kind of "glue" this is, I can't give you a specific product to say "this will work every time".
However, a product you can TEST (and I mean inconspicuously, and let it completely dry before you decide) is Goof Off. Some other people here may have some other products to suggest, and I hope they do.
You also might try contacting your local carpet store and asking them for suggestions, since they do that sort of thing more often than most people do.