Extending OneTool¶
Build custom tools for your projects. No OneTool source code required.
Tool Types¶
OneTool supports two types of user-created tools:
| Type | When to Use | Imports |
|---|---|---|
| Extension Tool | Most tools - no external dependencies | from ot.* |
| Isolated Tool | Tools needing external packages (numpy, pandas, etc.) | None (standalone) |
Extension tools (recommended) run in-process with full access to OneTool's logging, config, and secrets APIs.
Isolated tools run in separate subprocesses via PEP 723, providing complete dependency isolation.
Quick Start¶
- Create a tool file in
.onetool/tools/or your own directory - Add
pack = "mytool"and__all__ = ["function_name"] - Write your function with keyword-only arguments
- Configure
tools_dirinonetool.yamlto point to your tool - Restart the server
# .onetool/tools/mytool.py
pack = "mytool"
__all__ = ["greet"]
def greet(*, name: str) -> str:
"""Greet someone by name.
Args:
name: The name to greet
Returns:
A greeting message
"""
return f"Hello, {name}!"
Next Steps¶
- Extension Tools - In-process tools with OneTool API access
- Isolated Tools - Standalone tools with external dependencies