Tools
Tools give the agent the ability to act: adding to its knowledge base, editing its core documents, managing spaces, and more. Each tool is defined by a protocol, collected in a central registry, and gated by a permission system.
How it works
Every tool declares its name, permission requirements, a JSON schema (sent to the LLM so it knows how to call the tool), and an execute function. The registry provides definitions to the LLM and dispatches calls by name. Factory methods build different tool sets per context: the full set for normal chat, a restricted set for setup conversations, and a filtered set for background sessions.
Built-in tools
Built-in tools cover the agent's core capabilities: knowledge management, web search and fetch, space management, self-modification, scheduling, email, and awareness of time and location. Some are context-specific and appear only in certain session types. All tools return a JSON envelope with optional result, errors, and warnings.
Adding a tool
- Create a file implementing the tool protocol: name, capabilities, JSON schema, execute function.
- Add its capability to the capability enum.
- Register it in the tool registry.
The protocol and helpers handle argument parsing and output formatting, so most of the work is the tool's logic.