<< All versions
Skill v1.0.1
currentAutomated scan100/100azure-samples/art-voice-agent-accelerator/add-tool
1 files
──Details
PublishedMay 18, 2026 at 07:47 AM
Content Hashsha256:e9f716f8812e4000...
Git SHA3dda3db74e6c
Bump Typepatch
──Files
Files (1 file, 4.9 KB)
SKILL.md4.9 KBactive
SKILL.md · 154 lines · 4.9 KB
version: "1.0.1" name: add-tool description: Add a new tool to the agent toolstore registry
Add Tool Skill
Add tools to apps/artagent/backend/registries/toolstore/.
Tool File Structure
python
"""Tool Module Name================Brief description of tools in this module."""from __future__ import annotationsfrom typing import Anyfrom apps.artagent.backend.registries.toolstore.registry import register_toolfrom utils.ml_logging import get_loggerlogger = get_logger("agents.tools.module_name")# ═══════════════════════════════════════════════════════════════════════════════# SCHEMAS# ═══════════════════════════════════════════════════════════════════════════════tool_name_schema: dict[str, Any] = {"name": "tool_name","description": "Clear description of what this tool does and when to use it.","parameters": {"type": "object","properties": {"param1": {"type": "string", "description": "Parameter description"},"param2": {"type": "integer", "description": "Optional param"},},"required": ["param1"],},}# ═══════════════════════════════════════════════════════════════════════════════# EXECUTORS# ═══════════════════════════════════════════════════════════════════════════════async def tool_name(args: dict[str, Any]) -> dict[str, Any]:"""Execute the tool with given arguments."""param1 = (args.get("param1") or "").strip()if not param1:return {"success": False, "message": "param1 is required."}# Tool implementationlogger.info("Tool executed: %s", param1)return {"success": True,"result": "Tool output",}# ═══════════════════════════════════════════════════════════════════════════════# REGISTRATION# ═══════════════════════════════════════════════════════════════════════════════register_tool("tool_name",tool_name_schema,tool_name,tags={"category1", "category2"},)
Steps
- Create or edit file in
registries/toolstore/ - Define OpenAI-compatible schema with name, description, parameters
- Implement async executor function that takes
args: dict[str, Any] - Register tool with
register_tool()at module level - Import module in
registry.pyinitialize_tools()function - Add tool name to agent's
tools:list in theiragent.yaml
Registration Function
python
register_tool(name="tool_name", # Unique identifierschema=tool_name_schema, # OpenAI function schemaexecutor=tool_name, # Async functionis_handoff=False, # True if triggers agent transfertags={"category"}, # Optional categorizationoverride=False, # Allow re-registration)
Handoff Tools
For agent transfer tools, use is_handoff=True:
python
handoff_specialist_schema = {"name": "handoff_specialist","description": "Transfer to specialist agent for [reason].","parameters": {"type": "object","properties": {"reason": {"type": "string", "description": "Why transferring"},"context": {"type": "string", "description": "Relevant context"},},"required": ["reason"],},}async def handoff_specialist(args: dict[str, Any]) -> dict[str, Any]:return {"success": True,"handoff": True,"target_agent": "specialist","reason": args.get("reason", ""),}register_tool("handoff_specialist",handoff_specialist_schema,handoff_specialist,is_handoff=True,tags={"handoff"},)
Return Format
Always return dict with:
success: bool- Whether operation succeededmessage: str- Error message if failed- Additional result fields as needed
Registry Location
apps/artagent/backend/registries/toolstore/registry.py
Key functions:
register_tool()- Register a toolget_tools_for_agent(tool_names)- Get schemas for agentexecute_tool(name, args)- Execute a toolinitialize_tools()- Load all tool modules