Tools System Architecture
Overview
Tools are how Claude interacts with the world. Every action - reading files, running commands, searching code - is a tool. The tool system is modular, type-safe, and extensible.
Plain text
┌─────────────────────────────────────────────────────────────────────────────┐
│ TOOL SYSTEM │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ Tool │───►│ Input │───►│ Execution │ │
│ │ Definition │ │ Validation │ │ & UI │ │
│ │ (Zod) │ │ (Zod) │ │ │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
│ │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ BUILT-IN TOOLS │ │
│ │ ┌────────┐ ┌────────┐ ┌────────┐ ┌────────┐ ┌────────┐ ┌────────┐ │ │
│ │ │ Bash │ │ File │ │ File │ │ Glob │ │ Grep │ │ Web │ │ │
│ │ │ Tool │ │ Read │ │ Edit │ │ Tool │ │ Tool │ │ Search │ │ │
│ │ └────────┘ └────────┘ └────────┘ └────────┘ └────────┘ └────────┘ │ │
│ │ ┌────────┐ ┌────────┐ ┌────────┐ ┌────────┐ ┌────────┐ ┌────────┐ │ │
│ │ │ Agent │ │ Task │ │ LSP │ │ MCP │ │ Todo │ │ Config │ │ │
│ │ │ Tool │ │ Tools │ │ Tool │ │ Tool │ │ Tool │ │ Tool │ │ │
│ │ └────────┘ └────────┘ └────────┘ └────────┘ └────────┘ └────────┘ │ │
│ └─────────────────────────────────────────────────────────────────────┘ │
│ │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ EXTERNAL TOOLS (MCP) │ │
│ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ │ │
│ │ │ Postgres │ │ GitHub │ │ Custom │ │ │
│ │ │ Server │ │ Server │ │ Servers │ │ │
│ │ └──────────┘ └──────────┘ └──────────┘ │ │
│ └─────────────────────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────────┘