Where do tools do: agents or tasks?

It seems logical to me to have tools associated with tasks. Most of the examples and documentation show them associated with agents.
Which is the best?

@Baruch_Bashan There’s no right or wrong.

It’s just that 1 agent can execute n tasks.

Consequently:

  • If you attach a tool to the task, the tool can be used only with that task.
  • If you attach a tool to the agent, the tool can be used with any task that the agent executes.

Thank you! Still working to grasp the way this works.
Baruch

If you assign a tool to a task, no other task can use that tool. Is my understanding of what you are saying correct?