The ToolRegistryManager provides simplified tool registry management operations. It handles adding, removing, and updating tools in the official tools registry.
File: tools/tool_registry_manager.py
Class: ToolRegistryManager
Version: 1.0.0
Status: ✅ Active
class ToolRegistryManager(BaseTool):
- registry_path: Path - Tools registry file path
addAdds a new tool to the registry.
Parameters:
action (str, required): "add"tool_id (str, required): Tool identifiertool_config (Dict, required): Tool configurationReturns:
Tuple[bool, str] # (success, message)
removeRemoves a tool from the registry.
Parameters:
action (str, required): "remove"tool_id (str, required): Tool to removeReturns:
Tuple[bool, str] # (success, message)
updateUpdates an existing tool in the registry.
Parameters:
action (str, required): "update"tool_id (str, required): Tool to updatetool_config (Dict, required): Updated configurationReturns:
Tuple[bool, str] # (success, message)
from tools.tool_registry_manager import ToolRegistryManager
manager = ToolRegistryManager()
Add tool
success, message = await manager.execute(
action="add",
tool_id="custom_tool",
tool_config={
"name": "Custom Tool",
"description": "Tool description",
"version": "1.0.0",
"enabled": True
}
)
# Update tool
success, message = await manager.execute(
action="update",
tool_id="custom_tool",
tool_config={
"name": "Updated Custom Tool",
"version": "2.0.0"
}
)
# Remove tool
success, message = await manager.execute(
action="remove",
tool_id="custom_tool"
)
Straightforward operations:
Directly modifies:
data/config/official_tools_registry.jsonBasic error handling:
Directly modifies:
data/config/official_tools_registry.json
# Add, update, remove
await manager.execute("add", "tool1", {...})
await manager.execute("update", "tool1", {...})
await manager.execute("remove", "tool1")
core.bdi_agent.BaseTool: Base tool classutils.logging_config.get_logger: LoggingTools registry located at:
data/config/official_tools_registry.json