Tool Execution
The lifecycle of a tool call.
How Tools Work
Tools are the "hands" of an agent. They allow the LLM to interact with the outside world. In Bothive, every tool is a strictly typed function defined in TypeScript or automatically generated from an Integration.
The Execution Loop
1. Intent Detection
The LLM decides it needs to call a tool (e.g., `google.search`) to fulfill a query.
2. Parameter Validation
Bothive runtime validates the arguments against the tool's schema (e.g., checking if `query` is a string).
3. Execution & Networking
The actual code runs (or HTTP request is sent).
4. Observation
The tool result is fed back to the LLM as a system message.