create-atomic-tool
하는 일
AI 에이전트가 호출할 수 있는 타입 있는 입력과 출력을 가진 도구를 작성하는 방법을 설명합니다. 선택적 async 지원과 환경 변수의 비밀 값도 포함합니다. 에이전트에 기능을 더하려는 개발자를 위한 스킬입니다.
사용하는 경우
- ✓개발자가 에이전트가 타입이 있는 도구를 통해 외부 API를 호출하기를 원할 때.
- ✓개발자가 에이전트를 위해 간단한 계산기나 조회 도구를 원할 때.
- ✓개발자가 도구가 속도 제한이나 데이터 누락 같은 명확한 오류를 보고하기를 원할 때.
스킬 링크
https://github.com/Eigenwise/atomic-agents/blob/main/claude-plugin/atomic-agents/skills/create-atomic-tool/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“도시의 날씨를 조회해 기온과 날씨 상태를 반환하는 도구를 만들어 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
스킬은 도구가 무엇을 하고 무엇에 의존하는지 묻고, 입력 및 출력 스키마, 설정 클래스, run 메서드를 작성합니다. 비밀 값은 환경 변수에서 읽습니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Create an Atomic Agents Tool
A tool is a deterministic capability an agent can invoke. In Atomic Agents, every tool is a BaseTool[InSchema, OutSchema] subclass with a typed run() (and optional run_async()). The input/output schemas double as the tool's signature for the LLM and as Pydantic validation at runtime.
For deep material (MCP interop, distributing as a standalone package, advanced error patterns), the authority is ../framework/references/tools.md. This skill is the action-oriented path: clarify → write → verify.
When this fires vs the umbrella framework skill
- This skill: the user is creating a specific tool — wrapping an API, building a calculator, scraping a page, querying a DB.
frameworkskill: questions about Atomic Agents in general, or the user is doing something other than authoring a tool.
Phase 1 — Clarify
Bundle into one message:
- What does the tool do? One sentence. This becomes the class docstring and feeds the LLM's tool description.
- Inputs and outputs. Names, types, units. If unclear, propose a schema pair and confirm.
- External dependencies. HTTP API? DB? Local computation only? If HTTP, what auth (API key env var, OAuth, none)?
- Sync, async, or both? If the rest of the project is async or the call is I/O bound, plan a
run_async()alongsiderun(). - Failure modes. Rate limits, not-found, network errors — how should the agent see them? Default: typed failure output, not raised exceptions.
Skip any question already answered in context.
Phase 2 — Plan
Confirm the location and shape in one short block, then proceed:
- File:
<project>/tools/<tool_name>_tool.py(in-project tool — see../framework/references/project-structure.md). - Schemas:
<ToolName>Input,<ToolName>Output, optionally a typed failure shape. - Config:
<ToolName>Config(BaseToolConfig)if the tool needs API keys, base URLs, timeouts, retries. - Sync vs async: pick one or both.
- Error pattern: typed failure output (preferred) vs raise (only for programmer error).
Phase 3 — Implement
Skeleton — local computation, no config
from pydantic import Field
from atomic_agents import BaseIOSchema, BaseTool
class CalculatorInput(BaseIOSchema):
"""Arithmetic expression to evaluate."""
expression: str = Field(..., description="Python-style arithmetic, e.g. '2 + 2 * 3'.")
class CalculatorOutput(BaseIOSchema):
"""Result of evaluating the expression."""
result: float = Field(..., description="Numeric result.")
class CalculatorTool(BaseTool[CalculatorInput, CalculatorOutput]):
"""Evaluate simple arithmetic expressions safely."""
def run(self, params: CalculatorInput) -> CalculatorOutput:
import ast, operator as op
ops = {ast.Add: op.add, ast.Sub: op.sub, ast.Mult: op.mul, ast.Div: op.truediv}
def ev(n):
if isinstance(n, ast.Constant): return n.value
if isinstance(n, ast.BinOp): return ops[type(n.op)](ev(n.left), ev(n.right))
raise ValueError("unsupported")
return CalculatorOutput(result=ev(ast.parse(params.expression, mode="eval").body))
Skeleton — HTTP-backed, with config and typed failure
import os
import httpx
from typing import Literal, Optional
from pydantic import Field
from atomic_agents import BaseIOSchema, BaseTool, BaseToolConfig
class WeatherConfig(BaseToolConfig):
api_key: str = Field(
default_factory=lambda: os.environ.get("WEATHER_API_KEY", ""),
description="API key for the weather service.",
)
base_url: str = Field(
default="https://api.weather.example/v1",
description="Base URL for the weather API.",
)
timeout: float = Field(default=15.0, ge=1.0, le=120.0, description="Request timeout (s).")
class WeatherInput(BaseIOSchema):
"""A request for current weather conditions."""
city: str = Field(..., description="City name, e.g. 'Brussels'.")
class WeatherOutput(BaseIOSchema):
"""Current weather conditions, or a typed failure."""
status: Literal["ok", "error"] = Field(..., description="Outcome code.")
temperature_c: Optional[float] = Field(default=None, description="Temperature in Celsius.")
summary: Optional[str] = Field(default=None, description="Human-readable summary.")
error: Optional[str] = Field(default=None, description="Failure message when status='error'.")
class WeatherTool(BaseTool[WeatherInput, WeatherOutput]):
"""
자주 묻는 질문
API 키는 어디에 두나요?
스킬은 비밀 값을 코드에 쓰지 않고 환경 변수에서 읽는다고 말합니다.
async 지원이 필요한가요?
프로젝트가 async이거나 호출이 I/O를 기다릴 때만 필요합니다. 스킬은 async 버전을 추가할 수 있습니다.
오류는 어떻게 반환되나요?
스킬은 타입이 있는 실패 출력을 설명해, 오류가 발생했을 때 에이전트가 명확한 결과를 받도록 합니다.
상세 정보
작성자의 원본 설명
Build a `BaseTool[InSchema, OutSchema]` subclass — input/output schemas, `BaseToolConfig`, `run()` (and optional `run_async()`), env-driven secrets, typed failure outputs. Use when the user asks to "add a tool", "create a tool", "wrap an API as a tool", "build a `BaseTool`", "make a calculator/search/weather tool", or runs `/atomic-agents:create-atomic-tool`.
repo: Eigenwise/atomic-agents
인기도
- GitHub 스타
- 6.3k
- 순위
- #14240
- 라이선스
- MIT
- 업데이트
- 2026. 10. 29.
댓글
- …
이 저장소의 다른 스킬
create-atomic-agent
6.3k에이전트가 타입이 지정된 입력과 출력, 시스템 프롬프트, 선택한 AI 제공자로 새 Atomic Agents 에이전트를 만드는 데 도움을 줍니다.
create-atomic-context-provider
6.3k에이전트에 컨텍스트 제공자를 추가해, 현재 시간이나 검색된 문서 같은 최신 정보가 프롬프트에 나타나도록 돕습니다.
create-atomic-schema
6.3k에이전트와 도구를 위한 타입이 있는 입력 및 출력 스키마를 명확한 필드 설명과 함께 설계하도록 돕습니다.
framework
6.3k에이전트가 스키마, 에이전트, 도구, 프롬프트, 제공자 설정을 포함해 Atomic Agents Python 프레임워크를 올바르게 사용하도록 돕습니다.
비슷한 스킬
api-connector-builder
280k에이전트가 기존 패턴을 따라 새로운 API 연결을 만들도록 합니다. 새로운 방식을 도입하지 않고 연동을 하나 더 추가할 때 씁니다.
api-design
280k에이전트가 모범 사례에 따라 REST API를 설계하도록 돕습니다. API가 통신하는 방식, 오류를 보여 주는 방식, 데이터를 정리하는 방식을 정하는 데 유용합니다.
backend-patterns
280k에이전트가 서버 쪽 아키텍처 패턴과 데이터베이스 최적화를 다루도록 돕습니다. 서버에서 실행되는 코드를 만들거나 검토할 때 유용합니다.