It depends on the tool. If it's running a simple p4 command, you don't need any API beyond the CLI tool. If it's something more complex but nothing graphical, I'd write a Python script using P4Python. If it's a graphical tool where I needed to use Cocoa, I'd write it in Obj C (ugh) and use the C++ API.
thanks a lot, I will develop a graphical tool with you suggestion