Tool API Reference
TheTool API enables agents to interact with the outside world.
While language models excel at reasoning and generating text, tools allow agents to perform real actions such as querying databases, calling APIs, reading files, or executing custom business logic.
This page documents the public Tool API in BindAI.
Overview
A tool is a callable component that extends an agent’s capabilities. Conceptually:Creating a Tool
A tool is typically implemented as a Python function or callable object. Example:Registering a Tool
Tools are usually registered at the project level. Example:Tool Registry
Projects maintain a centralized tool registry.Tool Execution
During agent execution, the language model may decide to invoke a tool.Tool Inputs
Tools receive structured arguments supplied by the agent. Typical inputs include:- strings
- numbers
- booleans
- dictionaries
- lists
Tool Outputs
A tool returns data back to the agent. Examples include:- text
- JSON objects
- structured records
- search results
- API responses
Tool Context
Some tools require access to execution context. Conceptually:Tool Results
Tool execution may produce either:Shared Tools
A single tool can be shared across multiple applications.Local Tools
Some tools are specific to one application. Example:Tool Discovery
Agents only use tools that are explicitly registered or assigned to them. This improves:- security
- predictability
- performance
- prompt clarity
Error Handling
Tools should gracefully handle:- invalid input
- unavailable services
- authentication failures
- network errors
- unexpected exceptions
Security
Because tools often interact with external systems, they should:- validate user input
- sanitize parameters
- limit permissions
- protect secrets
- avoid exposing internal resources
Performance
Well-designed tools should:- minimize network requests
- cache expensive operations where appropriate
- reuse existing connections
- avoid unnecessary computation
Best Practices
- Design each tool for a single responsibility.
- Register reusable tools at the project level.
- Validate all incoming arguments.
- Return structured, predictable results.
- Handle failures gracefully.
- Keep tool interfaces stable.
- Document expected inputs and outputs.
Related APIs
The Tool API integrates with:- Agent
- Project
- Workflow
- Memory
- Knowledge
