Documentation menu
Documentation

Tools

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

Start from a fresh project

This guide is self-contained. Create an empty Ayjnt project, then replace the starter agent with the files shown below. Run commands from the new project directory unless a step says otherwise.

terminal
bunx ayjnt new try-tools --empty
cd try-tools
bun install

# remove agents/alive once you are ready to add the guide's files

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.

Run it and verify the result

Give the exported tools to your model, ask for the demonstrated action, and inspect which runtime executed it.

terminal
bun run build
bun run dev

# the local app is now available at http://localhost:8787