agentleFS
Azure-SamplesAzure-Samples/art-voice-agent-accelerator/.github/skills/add-tool/SKILL.md

add-tool

Skill74 starsChanged 9 months agoMITView on GitHub

Add a new tool to the agent toolstore registry

We split this skill into the rules it gives an agent

5 rules. 0 are common, 1 is distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 16 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Add tools to apps/artagent/backend/registries/toolstore/.

    line 8
  2. Very specific:

    Create or edit file in registries/toolstore/

    line 82
  3. Very specific:

    Import module in registry.py initialize_tools() function

    line 86
  4. Very specific:

    Add tool name to agent's tools: list in their agent.yaml

    line 87
  5. Distinctive:

    Always return dict with:

    line 139

“Common” is measured: kept by at least 6 in 10 of the 16 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Add Tool Skill

Add tools to apps/artagent/backend/registries/toolstore/.

Tool File Structure

"""
Tool Module Name
================

Brief description of tools in this module.
"""

from __future__ import annotations

from typing import Any

from apps.artagent.backend.registries.toolstore.registry import register_tool
from utils.ml_logging import get_logger

logger = 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 implementation
    logger.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

  1. Create or edit file in registries/toolstore/
  2. Define OpenAI-compatible schema with name, description, parameters
  3. Implement async executor function that takes args: dict[str, Any]
  4. Register tool with register_tool() at module level
  5. Import module in registry.py initialize_tools() function
  6. Add tool name to agent's tools: list in their agent.yaml

Registration Function

register_tool(
    name="tool_name",           # Unique identifier
    schema=tool_name_schema,    # OpenAI function schema
    executor=tool_name,         # Async function
    is_handoff=False,           # True if triggers agent transfer
    tags={"category"},          # Optional categorization
    override=False,             # Allow re-registration
)

Handoff Tools

For agent transfer tools, use is_handoff=True:

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 succeeded
  • message: 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 tool
  • get_tools_for_agent(tool_names) - Get schemas for agent
  • execute_tool(name, args) - Execute a tool
  • initialize_tools() - Load all tool modules

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.