tools/

Any @AITool-annotated function under tools/ becomes a callable tool.

On this page

tools/

Any .bx file under tools/ (searched recursively, so subfolders like tools/nested/Search.bx work too) that declares an @AITool-annotated function becomes a callable tool for the agent.

// tools/Greeter.bx
class {

	@AITool( "Say hello to someone by name." )
	function sayHello( name ) {
		return "Hello, " & arguments.name & "!";
	}

}

BxAgents doesn't interpret @AITool annotations itself. It copies the whole tools/ folder verbatim into the generated app, and the generated agent factory hands each agent's own folder to bx-ai's scanner, which does the real reflection work (walking the files, instantiating each class, finding @AITool functions). The tools it finds go to that agent only: a root agent's tools/ are not given to its subagents, and a subagent's tools/ are not given to its parent.

Tip

bxAgents add tool scaffolds one: it asks for the name, the function, what it does and its arguments, and writes tools/<Name>.bx (or a subagent's own tools/) in this shape. See add.

Tools from modules

Tools that modules register with bx-ai (its built-ins, bx-playwright, ...) are not attached to anything automatically. Name the ones an agent should have in its tools: list, as item@module or *@module.

Naming

The discovered entry name is the file's own base name (Greeter.bx β†’ Greeter). Two tool files with the same base name (even in different subfolders, since discovery is flat by base name) fail validation with a duplicate-name error.

Names of the tools BX Agents adds

The tools BX Agents itself gives an agent are all named {type}_{action} in lower case, so that tool permissions can match them by pattern (routine_*, *_delete) without a list of special cases:

ToolFrom
note_remember, note_forgetnotes
skill_saveskills
vault_list, vault_requestthe vault
routine_schedule, routine_list, routine_update, routine_pause, routine_resume, routine_run, routine_deleteroutines
report_save, report_list, report_readroutines

Tools of bx-ai and tools you write keep the names you give them. Following the same shape in your own is a good idea.

What's excluded

  • Dotfiles (anything starting with .) are ignored by discovery.
  • .env/dotfiles inside tools/ are never copied into the build output, even if present - the copy step explicitly excludes them.

Rebuilds

tools/ is copied with a wipe-then-write strategy: the generated app's own tools/ directory is deleted and rewritten on every build, so a file removed from your project's tools/ folder doesn't linger as stale output from a previous build.

Edit this page Download Markdown Last updated Nov 26, 2026, 8:45:51 AM Report an issue