tool-bar-mode
is a global mode. You can of course turn it on or off on a mode hook, but it affects all buffers in all frames.
As @legoscia mentioned, you can make the tool bar frame-specific. tool-bar-here-mode
makes this easier (togglable). It is in library tool-bar+.el
I don't think you can easily limit use of the tool bar to a particular mode.
However, you can make showing the tool bar be on-demand when you click Buttons
in the menu bar. This saves screen real estate: Show the tool bar temporarily, for the space of a single use.
This is available with tool-bar-popup-mode
, which is also in library tool-bar+.el
.