Loading...
    • 개발자 가이드
    • API 참조
    • MCP
    • 리소스
    • 릴리스 노트
    Search...
    ⌘K
    첫 단계
    Claude 소개빠른 시작
    모델 및 가격
    모델 개요모델 선택Claude 4.5의 새로운 기능Claude 4.5로 마이그레이션모델 지원 중단가격
    Claude로 빌드
    기능 개요Messages API 사용컨텍스트 윈도우프롬프팅 모범 사례
    기능
    프롬프트 캐싱컨텍스트 편집Extended thinking노력메시지 스트리밍배치 처리인용다국어 지원토큰 계산임베딩비전PDF 지원Files API검색 결과구조화된 출력Google Sheets 애드온
    도구
    개요도구 사용 구현 방법토큰 효율적인 도구 사용세분화된 도구 스트리밍Bash 도구코드 실행 도구프로그래밍 방식 도구 호출컴퓨터 사용 도구텍스트 편집기 도구웹 페치 도구웹 검색 도구메모리 도구도구 검색 도구
    Agent Skills
    개요빠른 시작모범 사례API와 함께 Skills 사용
    Agent SDK
    개요TypeScript SDKPython SDK마이그레이션 가이드
    가이드
    스트리밍 입력권한 처리세션 관리SDK의 구조화된 출력Agent SDK 호스팅시스템 프롬프트 수정SDK의 MCP사용자 정의 도구SDK의 서브에이전트SDK의 슬래시 명령SDK의 Agent Skills비용 및 사용량 추적할 일 목록SDK의 플러그인
    API의 MCP
    MCP 커넥터원격 MCP 서버
    타사 플랫폼의 Claude
    Amazon BedrockMicrosoft FoundryVertex AI
    프롬프트 엔지니어링
    개요프롬프트 생성기프롬프트 템플릿 사용프롬프트 개선기명확하고 직접적으로예제 사용 (다중 샷 프롬프팅)Claude가 생각하도록 하기 (CoT)XML 태그 사용Claude에게 역할 부여 (시스템 프롬프트)Claude의 응답 미리 채우기복잡한 프롬프트 연결긴 컨텍스트 팁Extended thinking 팁
    테스트 및 평가
    성공 기준 정의테스트 케이스 개발평가 도구 사용지연 시간 감소
    보안 강화
    환각 감소출력 일관성 증가탈옥 완화스트리밍 거부프롬프트 유출 감소Claude 캐릭터 유지
    관리 및 모니터링
    Admin API 개요사용량 및 비용 APIClaude Code Analytics API
    Console
    Log in
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...

    Solutions

    • AI agents
    • Code modernization
    • Coding
    • Customer support
    • Education
    • Financial services
    • Government
    • Life sciences

    Partners

    • Amazon Bedrock
    • Google Cloud's Vertex AI

    Learn

    • Blog
    • Catalog
    • Courses
    • Use cases
    • Connectors
    • Customer stories
    • Engineering at Anthropic
    • Events
    • Powered by Claude
    • Service partners
    • Startups program

    Company

    • Anthropic
    • Careers
    • Economic Futures
    • Research
    • News
    • Responsible Scaling Policy
    • Security and compliance
    • Transparency

    Learn

    • Blog
    • Catalog
    • Courses
    • Use cases
    • Connectors
    • Customer stories
    • Engineering at Anthropic
    • Events
    • Powered by Claude
    • Service partners
    • Startups program

    Help and security

    • Availability
    • Status
    • Support
    • Discord

    Terms and policies

    • Privacy policy
    • Responsible disclosure policy
    • Terms of service: Commercial
    • Terms of service: Consumer
    • Usage policy
    도구

    Claude와 함께하는 도구 사용

    Claude는 도구와 함수와 상호작용할 수 있어, Claude의 기능을 확장하여 더 다양한 작업을 수행할 수 있습니다.

    새로운 강좌의 일부로 Claude와 함께하는 도구 사용을 마스터하는 데 필요한 모든 것을 배워보세요! 이 양식을 사용하여 계속해서 아이디어와 제안을 공유해 주세요.

    다음은 Messages API를 사용하여 Claude에게 도구를 제공하는 방법의 예시입니다:

    curl https://api.anthropic.com/v1/messages \
      -H "content-type: application/json" \
      -H "x-api-key: $ANTHROPIC_API_KEY" \
      -H "anthropic-version: 2023-06-01" \
      -d '{
        "model": "claude-sonnet-4-5",
        "max_tokens": 1024,
        "tools": [
          {
            "name": "get_weather",
            "description": "Get the current weather in a given location",
            "input_schema": {
              "type": "object",
              "properties": {
                "location": {
                  "type": "string",
                  "description": "The city and state, e.g. San Francisco, CA"
                }
              },
              "required": ["location"]
            }
          }
        ],
        "messages": [
          {
            "role": "user",
            "content": "What is the weather like in San Francisco?"
          }
        ]
      }'

    도구 사용 작동 방식

    Claude는 두 가지 유형의 도구를 지원합니다:

    1. 클라이언트 도구: 사용자 시스템에서 실행되는 도구로, 다음을 포함합니다:

      • 사용자가 생성하고 구현하는 사용자 정의 커스텀 도구
      • 클라이언트 구현이 필요한 컴퓨터 사용 및 텍스트 편집기와 같은 Anthropic 정의 도구
    2. 서버 도구: 웹 검색 및 웹 가져오기 도구와 같이 Anthropic 서버에서 실행되는 도구입니다. 이러한 도구는 API 요청에서 지정되어야 하지만 사용자 측에서 구현할 필요는 없습니다.

    Anthropic 정의 도구는 모델 버전 간 호환성을 보장하기 위해 버전이 지정된 유형(예: web_search_20250305, text_editor_20250124)을 사용합니다.

    클라이언트 도구

    다음 단계에 따라 클라이언트 도구를 Claude와 통합하세요:

    1. 1

      Claude에게 도구와 사용자 프롬프트 제공

      • API 요청에서 이름, 설명, 입력 스키마와 함께 클라이언트 도구를 정의합니다.
      • 이러한 도구가 필요할 수 있는 사용자 프롬프트를 포함합니다. 예: "샌프란시스코의 날씨는 어때요?"
    2. 2

      Claude가 도구 사용을 결정

      • Claude는 어떤 도구가 사용자의 쿼리에 도움이 될 수 있는지 평가합니다.
      • 그렇다면 Claude는 적절히 형식화된 도구 사용 요청을 구성합니다.
      • 클라이언트 도구의 경우, API 응답은 Claude의 의도를 나타내는 tool_use의 stop_reason을 가집니다.
    3. 3

      도구 실행 및 결과 반환

      • Claude의 요청에서 도구 이름과 입력을 추출합니다
      • 사용자 시스템에서 도구 코드를 실행합니다
      • tool_result 콘텐츠 블록을 포함하는 새로운 user 메시지로 결과를 반환합니다
    4. 4

      Claude가 도구 결과를 사용하여 응답 작성

      • Claude는 도구 결과를 분석하여 원래 사용자 프롬프트에 대한 최종 응답을 작성합니다.

    참고: 3단계와 4단계는 선택사항입니다. 일부 워크플로우의 경우, Claude의 도구 사용 요청(2단계)만으로도 충분할 수 있으며, 결과를 Claude에게 다시 보낼 필요가 없습니다.

    서버 도구

    서버 도구는 다른 워크플로우를 따릅니다:

    1. 1

      Claude에게 도구와 사용자 프롬프트 제공

      • 웹 검색 및 웹 가져오기와 같은 서버 도구는 고유한 매개변수를 가집니다.
      • 이러한 도구가 필요할 수 있는 사용자 프롬프트를 포함합니다. 예: "AI에 대한 최신 뉴스를 검색해 주세요" 또는 "이 URL의 콘텐츠를 분석해 주세요."
    2. 2

      Claude가 서버 도구 실행

      • Claude는 서버 도구가 사용자의 쿼리에 도움이 될 수 있는지 평가합니다.
      • 그렇다면 Claude는 도구를 실행하고, 결과가 자동으로 Claude의 응답에 통합됩니다.
    3. 3

      Claude가 서버 도구 결과를 사용하여 응답 작성

      • Claude는 서버 도구 결과를 분석하여 원래 사용자 프롬프트에 대한 최종 응답을 작성합니다.
      • 서버 도구 실행을 위한 추가적인 사용자 상호작용은 필요하지 않습니다.

    도구 사용 예시

    다양한 도구 사용 패턴과 기법을 보여주는 몇 가지 코드 예시입니다. 간결함을 위해 도구는 간단한 도구이며, 도구 설명은 최상의 성능을 보장하기 위해 이상적인 것보다 짧습니다.


    가격

    Tool use requests are priced based on:

    1. The total number of input tokens sent to the model (including in the tools parameter)
    2. The number of output tokens generated
    3. For server-side tools, additional usage-based pricing (e.g., web search charges per search performed)

    Client-side tools are priced the same as any other Claude API request, while server-side tools may incur additional charges based on their specific usage.

    The additional tokens from tool use come from:

    • The tools parameter in API requests (tool names, descriptions, and schemas)
    • tool_use content blocks in API requests and responses
    • tool_result content blocks in API requests

    When you use tools, we also automatically include a special system prompt for the model which enables tool use. The number of tool use tokens required for each model are listed below (excluding the additional tokens listed above). Note that the table assumes at least 1 tool is provided. If no tools are provided, then a tool choice of none uses 0 additional system prompt tokens.

    ModelTool choiceTool use system prompt token count
    Claude Opus 4.5auto, none
    any, tool
    346 tokens
    313 tokens
    Claude Opus 4.1auto, none
    any, tool
    346 tokens
    313 tokens
    Claude Opus 4auto, none
    any, tool
    346 tokens
    313 tokens
    Claude Sonnet 4.5auto, none
    any, tool
    346 tokens
    313 tokens
    Claude Sonnet 4auto, none
    any, tool
    346 tokens
    313 tokens
    Claude Sonnet 3.7 (deprecated)auto, none
    any, tool
    346 tokens
    313 tokens
    Claude Haiku 4.5auto, none
    any, tool
    346 tokens
    313 tokens
    Claude Haiku 3.5auto, none
    any, tool
    264 tokens
    340 tokens
    Claude Opus 3 (deprecated)auto, none
    any, tool
    530 tokens
    281 tokens
    Claude Sonnet 3auto, none
    any, tool
    159 tokens
    235 tokens
    Claude Haiku 3auto, none
    any, tool
    264 tokens
    340 tokens

    These token counts are added to your normal input and output tokens to calculate the total cost of a request.

    현재 모델별 가격은 모델 개요 표를 참조하세요.

    도구 사용 프롬프트를 보낼 때, 다른 API 요청과 마찬가지로 응답은 보고된 usage 메트릭의 일부로 입력 및 출력 토큰 수를 모두 출력합니다.


    다음 단계

    쿡북에서 바로 구현할 수 있는 도구 사용 코드 예시 저장소를 탐색해 보세요:

    계산기 도구

    정확한 수치 계산을 위해 간단한 계산기 도구를 Claude와 통합하는 방법을 배워보세요.

    고객 서비스 에이전트

    클라이언트 도구를 활용하여 지원을 향상시키는 반응형 고객 서비스 봇을 구축하세요.

    JSON 추출기

    Claude와 도구 사용이 비구조화된 텍스트에서 구조화된 데이터를 추출하는 방법을 확인하세요.