Agent skill
agenticx-tool-creator
Guide for creating custom tools in AgenticX including function decorator tools, MCP tool integration, tool registries, and remote tool access. Use when the user wants to create tools for agents, integrate external APIs as tools, build MCP servers, or extend agent capabilities with custom functions.
Install this agent skill to your Project
npx add-skill https://github.com/DemonDamon/AgenticX/tree/main/agenticx/skills/agenticx-tool-creator
Metadata
Additional technical details for this skill
- author
- AgenticX
- version
- 0.3.6
SKILL.md
AgenticX Tool Creator
Guide for building tools that extend agent capabilities.
Tool Architecture
AgenticX tools inherit from BaseTool and are consumed by agents during execution. Three approaches exist:
- Function decorator (
@tool) — fastest for simple tools - Class-based (extend
BaseTool) — for complex or stateful tools - MCP remote tools — for external services via Model Context Protocol
Function Decorator Tools
from agenticx.tools import tool
@tool
def search_web(query: str) -> str:
"""Search the web for information.
Args:
query: The search query string.
Returns:
Search results as text.
"""
# implementation
return f"Results for: {query}"
@tool
def read_file(path: str) -> str:
"""Read contents of a local file."""
with open(path) as f:
return f.read()
The @tool decorator reads the function signature and docstring to generate the tool schema automatically. The docstring is the tool description the LLM sees.
Class-Based Tools
For tools needing initialization, state, or complex logic:
from agenticx.core import BaseTool
class DatabaseQuery(BaseTool):
name = "database_query"
description = "Query the project database."
def __init__(self, connection_string: str):
super().__init__()
self.conn = connect(connection_string)
def _run(self, sql: str) -> str:
return self.conn.execute(sql).fetchall()
Tool Registry
Register and discover tools globally:
from agenticx.core import ToolRegistry
registry = ToolRegistry()
registry.register(search_web)
registry.register(read_file)
# List all registered tools
for t in registry.list_tools():
print(f"{t.name}: {t.description}")
MCP Integration
AgenticX supports the Model Context Protocol for remote tool access.
Connecting to an MCP Server
from agenticx.protocols import MCPClient
client = MCPClient(server_url="http://localhost:3000")
tools = client.list_tools()
# Use MCP tools like local tools
result = client.call_tool("search", {"query": "AI agents"})
Building an MCP Server
AgenticX agents can be exposed as MCP-compatible services:
from agenticx.protocols import MCPServer
server = MCPServer(host="0.0.0.0", port=3000)
server.register_tool(search_web)
server.register_tool(read_file)
server.start()
Skill-Based Tools
Skills (SKILL.md bundles) are also exposed as tools via SkillTool:
from agenticx.tools.skill_bundle import SkillBundleLoader, SkillTool
loader = SkillBundleLoader()
skill_tool = SkillTool(loader=loader)
# Agents can invoke: skill_tool("list") or skill_tool("read <skill-name>")
Tool Design Guidelines
- Clear docstrings — the LLM uses the docstring to decide when to call the tool
- Type hints — always annotate parameters and return types
- Error handling — return descriptive error messages, don't raise bare exceptions
- Minimal scope — one tool, one purpose
- Idempotent when possible — safe to retry without side effects
- Test independently — verify tools work before attaching to agents
Advanced: Tool Context
Tools can access execution context:
@tool
def contextual_tool(query: str, _context: "ToolContext" = None) -> str:
"""A tool that uses execution context."""
if _context:
user = _context.user
session = _context.session_id
return f"Processed: {query}"
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agenticx-skill-manager
Guide for managing AgenticX skills including listing, searching, installing, uninstalling, publishing, and running a skill registry server. Use when the user wants to manage skills, find available skills, publish custom skills, set up a skill registry, or understand the skill ecosystem.
agenticx-deployer
Guide for deploying AgenticX agents to production including Docker containerization, Kubernetes orchestration, Volcengine AgentKit cloud deployment, and API server setup. Use when the user wants to deploy agents, containerize applications, set up Kubernetes, configure cloud deployment, or run the AgenticX API server in production.
agenticx-a2a-connector
Guide for using the A2A (Agent-to-Agent) communication protocol in AgenticX including agent discovery, skill invocation, remote agent cards, and distributed agent systems. Use when the user wants agents to communicate with each other, set up distributed agent systems, invoke remote agent skills, or build agent-to-agent workflows.
agenticx-quickstart
AgenticX zero-to-hero quickstart guide. Use when the user wants to get started with AgenticX, create their first project, build their first agent, or run their first workflow. Covers installation, project scaffolding, agent creation, task execution, and CLI basics.
agenticx-workflow-designer
Guide for designing and running AgenticX workflows including sequential pipelines, parallel execution, graph-based orchestration, conditional routing, and trigger services. Use when the user wants to create workflows, orchestrate multiple agents, design agent pipelines, or set up complex multi-step processes.
agenticx-memory-architect
Guide for setting up and using the AgenticX memory system including Mem0 integration, long-term memory, context management, and memory-enhanced agents. Use when the user wants to add memory to agents, persist conversation history, build memory-aware workflows, or integrate with Mem0 for long-term recall.
Didn't find tool you were looking for?