Anthropic 의 tool-use 스토리엔 — 나중에 갚는 — 작은 트위스트가 있어: tool 을 세 카테고리 로 나눠. 모두 같은 tools 배열에 정의되지만 모양이 달라.
- Custom tools — 네 tool,
name,description,input_schema(JSON Schema) 로 정의. 95% 의 개발자가 처음 손대는 거고 다른 provider 와 동일해 보임. - Anthropic-defined tools — Anthropic 이 ship 해서 모델이 native 로 아는 pre-built tool —
computer_20250124,text_editor_20250124,bash_20250124. 타입으로 선언; Anthropic 이 schema 소유. 그 존재가 Claude 가 Claude Code 에서 — 액션 동사를 직접 가르치지 않고도 — 진짜 컴퓨터를 조작할 수 있는 이유야. - MCP server tools — Anthropic API 가 MCP server 와 직접 대화할 수 있고, custom tool 옆에 같은 배열에 광고. MCP track 에서 다시 볼 거야.
기계적으로 Anthropic loop 는 깔끔: tool 과 메시지 보내고 content block 받음. Response 의 content 는 list — text block 은 type: "text", tool call 은 type: "tool_use" 에 name 과 input (진짜 dict, JSON 문자열 아님). Tool 결과는 user 메시지에 원본 tool_use.id 참조하는 tool_result block 으로 다시 보냄.
stop_reason 필드가 loop 의 권위 있는 신호: "end_turn" 은 모델 끝, "tool_use" 는 tool 호출, "max_tokens" 는 budget 소진. 거기서 분기 — 텍스트에서 절대 분기 X.