Documentation menu
Documentation

Tools

Give models small capabilities with explicit schemas, descriptions, and execution boundaries.

Two tool locations

Call agentTools(this) to receive one AI SDK ToolSet containing local agent tools plus allowed host proxies. Worker-side tools win name collisions.

FileRuntimeGood for
tools.tsworkerdfetch, bindings, durable state, deployable services
tools.host.tsBunfiles, shell, processes, local databases, native connectors

Design for a person to supervise

  • Describe the effect, not just the function name.
  • Validate every model-produced argument.
  • Confine paths and use argument arrays instead of shell interpolation.
  • Separate preparing an action from committing it.
  • Put approval immediately before consequential writes or execution.