Extending OneTool¶
Drop a file. Get a pack. No registration.
Adding tools to OneTool is trivial - create a Python file, declare a pack, and you're done.
Developer Guides¶
| Guide | Description |
|---|---|
| Creating Tools | Add custom tool functions |
| Creating Plugins | Build tools in separate repositories |
| Creating CLIs | Build command-line interfaces |
| Testing | Test markers and organization |
| Logging | Structured logging with LogSpan |
Quick Start: Adding a Tool¶
- Create a file in
src/ot_tools/:
# src/ot_tools/mytool.py
pack = "mytool"
__all__ = ["search"]
def search(*, query: str) -> str:
"""Search for items.
Args:
query: Search query
Returns:
Search results
"""
return f"Results for: {query}"
-
Restart
ot-serve- the tool is auto-discovered. -
Use it:
Architecture¶
src/
├── ot/ # Core library
├── ot_sdk/ # SDK for worker tools
├── ot_tools/ # Built-in tools (auto-discovered)
├── ot_serve/ # CLI: ot-serve
└── ot_bench/ # CLI: ot-bench
Contributing¶
- Fork the repository
- Create a feature branch
- Install dev dependencies:
uv sync --group dev - Make changes
- Run tests:
uv run pytest - Submit a pull request
Code Style¶
- Format with
ruff format - Lint with
ruff check - Type check with
mypy