Skip to main content
An agent holds three lists: the tools it may call, the knowledge it may search, and the channels it answers on. Each one can be replaced whole, or changed one item at a time. Use the single-item routes. Adding one tool by sending the whole array forces you to read, merge and write — and two clients doing that at the same time lose one of the changes. Here the server does the merge.

The routes

All of them need agents:write and all of them return the whole agent, so you can see the result without a second read.

Example

Errors worth knowing

404 AGENT_TOOL_NOT_FOUND

No tool in this company with that id. It is rejected rather than stored: an agent silently ignores a tool it cannot find, so saving it would be a 200 with no effect.

404 CHANNEL_TYPE_NOT_FOUND

The channel type is not in the catalogue. The error lists the valid ones.

404 AGENT_NOT_FOUND

No agent with that id in the token’s company and project.

Operational notes

  • Adding something that is already there succeeds. These are idempotent: the end state is what you asked for.
  • Removing unassigns, it does not delete. A detached tool still exists in the company and a detached node still exists in the knowledge base.
  • Enabling a channel on the agent is only half of it. The account also has to be connected to the company. One half without the other answers nothing, and it is the most common cause of “the agent is not replying”.
  • Concurrent writes to the same agent still race. The platform replaces the whole array on every save, so the server-side merge removes your round trip, not the race. Serialise writes per agent.