tool-creator
БесплатноБез исполняемых скриптовНе проверенCreate new tools or upgrade existing tools for the agent. MANDATORY: Use this skill whenever the user wants to create a custom tool, convert a script into a…
от gabrielmoreira★ 23 звезды на GitHubОб этом скилле
Tool Creator
A skill for creating new agent tools and upgrading existing ones.
Tools are Python functions decorated with @tool from langchain_core.tools that the agent can call directly during conversations. Unlike skills (which are instruction documents), tools are executable code that extend the agent's capabilities.
Tool Format
Every tool MUST follow this exact pattern to be compatible with the deepagents framework:
import logging
from langchain_core.tools import tool
logger = logging.getLogger(__name__)
@tool
def my_tool_name(param1: str, param2: int) -> str:
"""Clear description of what this tool does.
Provide enough detail so the agent knows WHEN and HOW to use this tool.
The docstring is the primary mechanism for the agent to decide whether to call it.
Args:
param1: Description of param1
param2: Description of param2
Returns:
Description of what is returned
"""
logger.info(f"[my_tool_name] params: param1={param1}, param2={param2}")
# Tool logic here
result = f"Processed {param1} with {param2}"
logger.info(f"[my_tool_name] result: {result}")
return result
Critical Rules
- One tool per file: Each
.pyfile in the Tools directory should contain exactly one@toolfunction. - File name = function name: The file should be named after the tool function (e.g.,
my_tool_name.pycontainsdef my_tool_name(...)). - Type hints are required: All parameters and return types must have type annotations.
- Docstring is essential: The docstring serves as the tool's description for the agent. Write it clearly — it determines when and how the agent will use the tool.
- Use logging: Always log inputs and outputs using the
loggerfor debugging. - Tools run in the sandbox: All
@toolfunctions execute in the sandbox container — the same environment where test scripts run. This means the testing environment IS the production environment. You can import any package available in the sandbox. - Pure functions preferred: Tools should ideally be stateless. If state is needed, use file I/O or external services.
- Return serializable types: Return
str,int,float,bool,dict, orlist— types that can be serialized in the agent's conversation.
Available Packages (Sandbox Environment)
All @tool functions execute in the sandbox container — the same environment where test scripts run. The following packages are pre-installed:
- Python standard library (json, os, re, math, datetime, pathlib, etc.)
httpx— HTTP client for API callspydantic— Data validationlangchain_core— Required for@tooldecoratorpyyaml— YAML parsingseekr_sdk— Providesweb_search,web_crawl,web_crawl_manyfor internet search and page crawling. When writing@toolfunctions that need to search the web or crawl pages, always preferseekr_sdkover rawhttpxcalls. See the "Web-Enabled Tool (using seekr_sdk)" example below.
Since tools run in the same sandbox where you test them, if your test passes in the sandbox, the tool will also work in production. If a tool needs a package not in this list, install it in the sandbox Dockerfile (docker-compose.yml sandbox service).
Docstring Writing Guide
The docstring is how the agent decides whether to call a tool. Good docstrings:
- First line: A concise summary of what the tool does (this appears in tool listings)
- Body: Explain when to use this tool, what scenarios it covers, and any important constraints
- Args section: Describe each parameter with its expected format and examples
- Returns section: Describe the return value and its format
Make descriptions specific and "pushy" enough that the agent reliably triggers the tool for relevant tasks. For example:
Bad: """Calculate a score."""
Good: """根据身高、体重、年龄计算人物综合打分。该工具根据人的身体数据进行综合评估打分,包括BMI健康指数评分和年龄评分。"""
Mode 1: Creating a New Tool
When the user wants to create a new tool from scratch or convert a script into a tool:
Step 1: Understand Requirements
Ask the user:
- What should this tool do? What problem does it solve?
- What inputs does it need? (parameter names, types, examples)
- What should it return? (type, format)
- Does it need external API calls or only local computation?
- Are there edge cases or error conditions to handle?
If the user already has a script or describes the logic clearly, extract the answers from context.
Step 2: Write the Tool (as @tool from the start)
CRITICAL: Write the code directly as an @tool function from the very beginning. Do NOT first write a standalone script and then convert it — this leads to mismatches between tested and saved code.
Based on the requirements, write a complete tool file following the format above. Key considerations:
- Choose a clear, descriptive function name using
snake_case - Write a comprehensive docstring
- Add proper erro
Установить tool-creator в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл tool-creator?
Create new tools or upgrade existing tools for the agent. MANDATORY: Use this skill whenever the user wants to create a custom tool, convert a script into a reusable tool, write a new tool function, upgrade or modify an existing tool, test and improve a tool in the sandbox, or asks things like 'make a tool for X', 'create a tool that does Y', 'improve the X tool', 'upgrade my tool', 'turn this script into a tool'. Even if the user doesn't use the word 'tool' explicitly, trigger this if they want to add a new callable capability to the agent or modify an existing one.
Как установить скилл tool-creator?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл tool-creator запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
docx
Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
от AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
от Anthropicxlsx
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
от Anthropicpptx
Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…
от Anthropic