mirror of
https://github.com/hanzoai/python-sdk.git
synced 2026-10-23 20:23:00 +00:00
Packaging metadata (twine check was PASSED-with-warnings -> clean PASS): - config/llm/mcp/vector: add missing 'readme = README.md' ([project] key); README files existed but were never wired into the dist metadata. - net/plan/vcs: fill empty (0-byte) README.md files referenced by the readme key, so long_description is no longer missing. Tests (hanzo-tools-core/test_all_tools.py drifted from current sources): - browser: 1 -> 3 tools (browser, cdp, playwright after the zapd split) - mcp_tools: 4 -> 5 tools - required-tool total: 21 -> 23
hanzo-tools-core
Core infrastructure for Hanzo MCP tools.
Installation
pip install hanzo-tools-core
Components
BaseTool
Base class for all Hanzo tools.
from hanzo_tools.core import BaseTool
class MyTool(BaseTool):
name = "my_tool"
@property
def description(self) -> str:
return "My custom tool"
async def call(self, ctx, **params) -> str:
return "result"
ToolRegistry
Manage tool registration and discovery.
from hanzo_tools.core import ToolRegistry
ToolRegistry.register_tools(mcp_server, [MyTool()])
PermissionManager
Access control for file and command operations.
from hanzo_tools.core import PermissionManager
pm = PermissionManager(allowed_paths=["/home/user/project"])
if pm.can_access("/home/user/project/file.py"):
# proceed
Decorators
from hanzo_tools.core import auto_timeout
@auto_timeout("my_tool")
async def my_function():
# Auto-backgrounds after timeout
pass
License
MIT