The LLMToolManager provides specialized management for LLM tools in the official tools registry. It handles adding, removing, and updating LLM tools with automatic A2A model card creation and cryptographic identity management.
File: tools/llm_tool_manager.py
Class: LLMToolManager
Version: 1.0.0
Status: ✅ Active
class LLMToolManager(BaseTool):
- memory_agent: MemoryAgent - For workspace management
- tool_registry_path: Path - Tools registry file path
- model_cards_path: Path - Model cards directory
addAdds a new LLM 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 an LLM tool from the registry.
Parameters:
action (str, required): "remove"tool_id (str, required): Tool to removeReturns:
Tuple[bool, str] # (success, message)
updateUpdates an existing LLM 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.llm_tool_manager import LLMToolManager
from agents.memory_agent import MemoryAgent
manager = LLMToolManager(memory_agent=memory_agent)
Add LLM tool
success, message = await manager.execute(
action="add",
tool_id="custom_llm_tool",
tool_config={
"name": "Custom LLM Tool",
"description": "Specialized LLM tool",
"version": "1.0.0",
"enabled": True,
"commands": [...],
"access_control": {...}
}
)
# Update LLM tool
success, message = await manager.execute(
action="update",
tool_id="custom_llm_tool",
tool_config={
"name": "Updated LLM Tool",
"version": "2.0.0"
}
)
When adding or updating LLM tools:
{
"id": "tool_id",
"name": "Tool Name",
"description": "Tool description",
"type": "tool",
"version": "1.0.0",
"enabled": true,
"commands": [...],
"access_control": {...},
"identity": {
"public_address": "0x...",
"signature": "..."
},
"a2a_endpoint": "https://mindx.internal/{tool_id}/a2a"
}
Specialized for LLM tools:
Creates A2A model cards:
Integrates with IDManagerAgent:
Manages identities:
id_manager = await IDManagerAgent.get_instance()
identity = await id_manager.get_identity(item_id)
Manages model cards:
self.model_cards_path = self.memory_agent.get_agent_data_directory("a2a_model_cards")
# 1. Add LLM tool
await manager.execute("add", "llm_analyzer", {...})
2. Update LLM tool
await manager.execute("update", "llm_analyzer", {...})
3. Remove LLM tool
await manager.execute("remove", "llm_analyzer")
core.id_manager_agent.IDManagerAgent: Identity managementagents.memory_agent.MemoryAgent: Workspace managementcore.bdi_agent.BaseTool: Base tool classTools registry located at:
data/config/official_tools_registry.json
Model cards stored in:
data/memory/agent_workspaces/a2a_model_cards/