The RegistryManagerTool provides comprehensive management of both tool and agent registries. It handles adding, removing, and updating registry entries, and automatically creates A2A (Agent-to-Agent) model cards with cryptographic identities.
File: tools/registry_manager_tool.py
Class: RegistryManagerTool
Version: 1.0.0
Status: ✅ Active
class RegistryManagerTool(BaseTool):
- memory_agent: MemoryAgent - For workspace management
- tool_registry_path: Path - Tools registry file path
- agent_registry_path: Path - Agents registry file path
- model_cards_path: Path - Model cards directory
addAdds a new tool or agent to the registry.
Parameters:
registry_type (str, required): "tool" or "agent"action (str, required): "add"item_id (str, required): Unique identifieritem_config (Dict, required): Item configurationReturns:
Tuple[bool, str] # (success, message)
removeRemoves a tool or agent from the registry.
Parameters:
registry_type (str, required): "tool" or "agent"action (str, required): "remove"item_id (str, required): Item to removeReturns:
Tuple[bool, str] # (success, message)
updateUpdates an existing tool or agent in the registry.
Parameters:
registry_type (str, required): "tool" or "agent"action (str, required): "update"item_id (str, required): Item to updateitem_config (Dict, required): Updated configurationReturns:
Tuple[bool, str] # (success, message)
from tools.registry_manager_tool import RegistryManagerTool
from agents.memory_agent import MemoryAgent
tool = RegistryManagerTool(memory_agent=memory_agent)
Add tool
success, message = await tool.execute(
registry_type="tool",
action="add",
item_id="custom_analyzer",
item_config={
"name": "Custom Analyzer",
"description": "Specialized analysis tool",
"version": "1.0.0",
"enabled": True,
"commands": [...],
"access_control": {...}
}
)
# Update agent
success, message = await tool.execute(
registry_type="agent",
action="update",
item_id="analysis_agent",
item_config={
"name": "Updated Analysis Agent",
"description": "Enhanced analysis capabilities",
"version": "2.0.0"
}
)
# Remove tool
success, message = await tool.execute(
registry_type="tool",
action="remove",
item_id="old_tool"
)
When adding or updating items, the tool automatically:
{
"id": "item_id",
"name": "Item Name",
"description": "Item description",
"type": "tool" | "agent",
"version": "1.0.0",
"enabled": true,
"commands": [...],
"access_control": {...},
"identity": {
"public_key": "0x...",
"signature": "..."
},
"a2a_endpoint": "https://mindx.internal/{item_id}/a2a"
}
Manages both:
data/config/official_tools_registry.jsondata/config/official_agents_registry.jsonCreates model cards for:
Integrates with IDManagerAgent:
Saves registries to:
Creates identities:
id_manager = await IDManagerAgent.get_instance()
public_key, _ = await id_manager.create_new_wallet(item_id)
Manages model cards directory:
self.model_cards_path = self.memory_agent.get_agent_data_directory("a2a_model_cards")
# 1. Add new tool
await tool.execute("tool", "add", "new_tool", {...})
2. Update tool
await tool.execute("tool", "update", "new_tool", {...})
3. Remove tool
await tool.execute("tool", "remove", "new_tool")
core.id_manager_agent.IDManagerAgent: Identity managementagents.memory_agent.MemoryAgent: Workspace managementcore.bdi_agent.BaseTool: Base tool classdata/config/official_tools_registry.jsondata/config/official_agents_registry.jsondata/memory/agent_workspaces/a2a_model_cards/