How to Create Tools as Functions
1
Define Simple Function
2
Use with Agent
How to Create Tools as Lambda Functions
1
Define Lambda Tool
2
Use with Agent
How to Create Tools from External Libraries
1
Wrap Library Function
2
Use Wrapped Tool
How to Create Tools in tools.py File
1
Create tools.py
2
Reference in Template
How to Create Tools in a Package
1
Create Package Structure
2
Define Tools in Module
3
Export in __init__.py
4
Use as tools_source
How to Create Tools with Decorators
1
Use Tool Decorator
2
Use with Agent
How to Add Tools via CLI
1
Add Package Tools
2
Add Local File
3
Add from GitHub
4
Verify Added Tools
Tool Creation Methods Comparison
| Method | Best For | Complexity |
|---|---|---|
| Function | Simple tools | Low |
| Lambda | One-liners | Low |
| Class | Stateful tools | Medium |
| Package | Reusable tools | Medium |
| Decorator | Enhanced tools | Low |
| External wrap | Library integration | Medium |
| CLI add | Quick setup | Low |

