How should I cite a tool or a library in my article?
A good citation has the following properties:


Gives credit where it is due for an (idea, tool, dataset, etc.) that is not your own.
Directs the reader of your paper where to look, if he/she wants to verify that your claims about the (idea, tool, dataset, etc.) are correct.


Any of the following can be used to cite a tool, as long as the above properties are satisfied:


If the authors of a tool explain how they would like it to be cited, follow those recommendations.
If there is a paper or tech report about the tool, cite that, because that is what the authors would probably want (if they didn't specify). 
If there is no paper or TR, cite the website of the tool. 


Of course, in most cases, you're not the first person to cite the tool - go search Google Scholar for the name of the tool, and find out how others cited it.