From tac
Generates boilerplate for custom @tool-decorated functions in Claude Agent SDK, including MCP server setup and agent config. Use when adding tools to custom agents.
How this skill is triggered — by the user, by Claude, or both
Slash command
/tac:create-toolThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Generate custom tool boilerplate with @tool decorator.
Generate custom tool boilerplate with @tool decorator.
$1: Tool name (snake_case)$ARGUMENTS: Tool description and purpose (after name)You are creating a custom tool for use in custom agents.
Extract:
$1 (required, snake_case)If no name provided, STOP and ask for tool name. If no description provided, STOP and ask for tool purpose.
Based on the tool purpose, determine:
Create tool using @tool decorator:
from typing import Any
from claude_agent_sdk import tool
@tool(
"[tool_name]",
"[Description for agent - when to use this tool]",
{
"param1": str,
"param2": int,
}
)
async def [tool_name](args: dict[str, Any]) -> dict[str, Any]:
"""
[Brief docstring]
"""
try:
# Extract parameters
param1 = args["param1"]
param2 = args.get("param2", default_value)
# Validate inputs
if not param1:
return {
"content": [{"type": "text", "text": "Error: param1 required"}],
"is_error": True
}
# Perform operation
result = perform_operation(param1, param2)
# Return success
return {
"content": [{"type": "text", "text": str(result)}]
}
except Exception as e:
return {
"content": [{"type": "text", "text": f"Error: {str(e)}"}],
"is_error": True
}
from claude_agent_sdk import create_sdk_mcp_server
# Create server with tool
[server_name]_server = create_sdk_mcp_server(
name="[server_name]",
version="1.0.0",
tools=[[tool_name]]
)
from claude_agent_sdk import ClaudeAgentOptions, ClaudeSDKClient
options = ClaudeAgentOptions(
mcp_servers={"[server_name]": [server_name]_server},
allowed_tools=["mcp__[server_name]__[tool_name]"],
system_prompt=system_prompt,
model="opus",
)
# IMPORTANT: Use ClaudeSDKClient for custom tools
async with ClaudeSDKClient(options=options) as client:
await client.query(prompt)
async for message in client.receive_response():
pass
## Tool Created
**Name:** [tool_name]
**Server:** [server_name]
**Tool ID:** mcp__[server_name]__[tool_name]
### Tool Definition
```python
[Generated @tool decorated function]
[Generated server setup]
[Generated configuration]
| Name | Type | Required | Description |
|---|---|---|---|
| param1 | str | Yes | [description] |
| param2 | int | No | [description], default: [value] |
Agent prompt: "[example prompt that triggers tool]" Expected call: [tool_name](param1="value", param2=10) Expected result: "[expected output]"
# Test the tool directly
result = await [tool_name]({"param1": "test", "param2": 10})
assert "content" in result
assert not result.get("is_error", False)
npx claudepluginhub melodic-software/claude-code-plugins --plugin tacDesigns custom Python tools with @tool decorator for domain-specific agents, MCP servers, and Agent SDK. Guides interface, params, logic, and error handling.
Guides tool design for AI agents, covering JSON Schema, descriptions, validation, error handling, and the MCP standard.
Builds autonomous AI agents with Claude Agent SDK: computer use, tool calling, MCP integration, and production best practices for Anthropic models.