# Agenticx Tool Creator

Guide for creating custom tools in AgenticX including function decorator tools, MCP...

- Repository: https://github.com/DemonDamon/AgenticX (866 stars)
- Category: AI and agents
- License: Apache-2.0
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add DemonDamon/AgenticX --skill agenticx-tool-creator -g -a claude-code -y`
Codex: `npx skills add DemonDamon/AgenticX --skill agenticx-tool-creator -g -a codex -y`
Cursor: `npx skills add DemonDamon/AgenticX --skill agenticx-tool-creator -g -a cursor -y`
Gemini CLI: `npx skills add DemonDamon/AgenticX --skill agenticx-tool-creator -g -a gemini-cli -y`

## Description

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.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# 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:

1. **Function decorator** (`@tool`), fastest for simple tools
2. **Class-based** (extend `BaseTool`), for complex or stateful tools
3. **MCP remote tools**, for external services via Model Context Protocol

## Function Decorator Tools

```python
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:

```python
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:

```python
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

```python
from agenticx.protocols import MCPClient

The rest: https://github.com/DemonDamon/AgenticX/blob/HEAD/agenticx/skills/agenticx-tool-creator/SKILL.md
