Tool integration is in preview. APIs and behavior may change in future releases.
Overview
Tools in Nova Act are Python functions decorated with@tool that can be invoked by the agent during workflow execution. When the agent needs information or capabilities beyond what’s available in the browser, it can call these tools to accomplish the task.
Use cases
- Data providers: Fetch data from databases or APIs
- Authentication: Retrieve credentials from secure storage
- Calculations: Perform complex computations
- External systems: Integrate with CRM, billing, or other business systems
Creating tools
Use the@tool decorator to make any Python function available as a tool:
get_booking_reference("CUS123") when it needs the booking reference.
Tool requirements
Tools should have clear docstrings and type hints. The agent uses these to understand when and how to call the tool.
- Type hints: Add type annotations for all parameters and return values
- Docstrings: Describe what the tool does and when to use it
- Pure functions: Tools should be deterministic when possible
- Error handling: Handle exceptions gracefully and return meaningful error messages
Tool examples
Database query tool
API integration tool
Credentials provider tool
Complete workflow example
Here’s a complete example that books a flight using data from multiple tools:MCP (Model Context Protocol) integration
Nova Act supports tools from MCP servers using the Strands MCP Client.Using MCP tools
Available MCP servers
Many MCP servers are available for common integrations:- AWS Documentation: Search AWS documentation
- GitHub: Access repository data and issues
- File system: Read and write local files
- Database: Query SQL databases
- Web search: Search the internet
Best practices
Tool design
- Single responsibility: Each tool should do one thing well
- Clear naming: Use descriptive function names that indicate what the tool does
- Comprehensive docs: Write detailed docstrings explaining parameters and return values
- Type safety: Use type hints for all parameters and return values
Error handling
Security considerations
- Validate inputs: Always validate and sanitize tool inputs
- Least privilege: Tools should have minimal permissions needed
- Audit logging: Log tool invocations for security audits
- Rate limiting: Implement rate limits for external API calls
Testing tools
Test your tools independently before using them in workflows:Troubleshooting
Tool not being called
Tool not being called
Ensure:
- Tool has clear docstring describing when to use it
- Type hints are present for all parameters
- Tool name is descriptive
- Tool is included in the
toolslist - Your prompt mentions the need for external data
Tool returning incorrect data
Tool returning incorrect data
Check:
- Tool implementation logic
- Parameter types match what the agent is passing
- Return type is serializable (use dicts, not custom objects)
- Error handling is properly returning error info
Performance issues with tools
Performance issues with tools
Consider:
- Caching results for expensive operations
- Using async operations for I/O-bound tools
- Implementing timeouts for external API calls
- Reducing data returned to only what’s needed
Next steps
Strands integration
Learn about Strands agent framework integration
Code samples
See complete tool integration examples
MCP servers
Browse available MCP servers
API reference
@tool decorator API documentation