Skip to content

Tools

tool — the decorator

Turn an async function into a :class:ToolDefinition.

Usable bare (@tool), empty (@tool()) or configured (@tool(dangerous=True)). The argument schema is derived from type hints; the description comes from the docstring.

ToolDefinition

A tool ready to be registered on an :class:~toolloop.Agent.

execute(args) async

Validate args, run the tool, return (ok, observation).

Invalid arguments and raised exceptions become error observations the model can repair from — they never abort the agent loop.

Standard toolset

Batteries for coding agents, importable or ignorable:

from toolloop import STD_TOOLS
from toolloop.tools import bash, read_file, write_file, edit_file, list_files, grep

See Tools for the concepts.