Skip to main content
A tool is one of your own functions. tool, deferred and toolbelt from @bijectionhq/app-agents/install gather them into a belt. The belt is closed: the model can name only a tool in it, and a turn dispatches only a tool its agent’s settings list.
  • toolbelt(at, tools) takes the transcript label and returns { dispatch, catalog, names }. Place belt.dispatch in your tree and pass it as agents({ tool: belt.dispatch }). Pass belt.catalog as settings.tools.
  • tool(fn, { description, input }) offers a query at or below the belt’s label, or a mutation at exactly it. input restates the args the model supplies; the model reads their JSON Schema. A description is at most 1024 characters.
  • Tool names are model tool names ([A-Za-z0-9_-]{1,64}). ask_person is the built-in question tool and cannot be a belt name.
The dispatcher is a mutation under the transcript, run as each call’s own task. A tool that refuses or fails settles its call with the code, and the model reads why. It is never a refusal of the agents app’s transaction. Input that does not conform to input returns an error value the model reads.

Deferred tools

A tool that needs work outside the transaction before it has a result, such as a model call or a search that embeds its query, is deferred(start, { description, input }). start runs in the dispatcher’s transaction with the model’s input and the call. It submits what it needs and, from a continuation of its own, delivers the result before the settings’ toolDeadline:
toolCall is exported by @bijectionhq/app-agents. A call whose result does not arrive by its deadline settles, and the model reads that it expired. The retrieval library offers a ready deferred tool; see Knowledge.