docs: update tool-adding instructions for auto-discovery

- AGENTS.md: 3 files → 2 files, remove _discover_tools() step
- adding-tools.md: remove Step 3, note auto-discovery
- architecture.md: update discovery description
- tools-runtime.md: replace manual list with discover_builtin_tools() docs
- hermes-agent skill: remove manual import step
This commit is contained in:
Teknium 2026-04-14 21:03:34 -07:00 committed by Teknium
parent fc6cb5b970
commit ef04de3e98
5 changed files with 24 additions and 47 deletions

View file

@ -14,11 +14,12 @@ Make it a **Tool** when it requires end-to-end integration with API keys, custom
## Overview
Adding a tool touches **3 files**:
Adding a tool touches **2 files**:
1. **`tools/your_tool.py`** — handler, schema, check function, `registry.register()` call
2. **`toolsets.py`** — add tool name to `_HERMES_CORE_TOOLS` (or a specific toolset)
3. **`model_tools.py`** — add `"tools.your_tool"` to the `_discover_tools()` list
Any `tools/*.py` file with a top-level `registry.register()` call is auto-discovered at startup — no manual import list required.
## Step 1: Create the Tool File
@ -124,19 +125,9 @@ _HERMES_CORE_TOOLS = [
},
```
## Step 3: Add Discovery Import
## ~~Step 3: Add Discovery Import~~ (No longer needed)
In `model_tools.py`, add the module to the `_discover_tools()` list:
```python
def _discover_tools():
_modules = [
...
"tools.weather_tool", # <-- add here
]
```
This import triggers the `registry.register()` call at the bottom of your tool file.
Tool modules with a top-level `registry.register()` call are auto-discovered by `discover_builtin_tools()` in `tools/registry.py`. No manual import list to maintain — just create your file in `tools/` and it's picked up at startup.
## Async Handlers