# Tools Reference

Complete reference of all tools available in Claude Code agents and skills.

Source: https://code.claude.com/docs/en/

## Core File Tools

### Read
- **Purpose:** Read file contents from the filesystem
- **Input:** file_path (absolute), optional offset and limit for large files
- **Capabilities:** Text files, images (PNG, JPG), PDFs, Jupyter notebooks
- **Risk:** None (read-only)

### Write
- **Purpose:** Create or overwrite files
- **Input:** file_path (absolute), content
- **Risk:** Medium (overwrites existing files)
- **Requirement:** Must Read file first if it exists

### Edit
- **Purpose:** Find-and-replace edits in existing files
- **Input:** file_path, old_string, new_string, optional replace_all
- **Risk:** Medium (modifies files)
- **Requirement:** Must Read file first; old_string must be unique

### Glob
- **Purpose:** Find files by glob pattern
- **Input:** pattern (e.g., `**/*.ts`), optional path
- **Risk:** None (read-only)
- **Use for:** File discovery by name pattern

### Grep
- **Purpose:** Search file contents using regex
- **Input:** pattern (regex), optional path, glob filter, output_mode
- **Risk:** None (read-only)
- **Use for:** Content search, finding implementations

## Execution Tools

### Bash
- **Purpose:** Execute shell commands
- **Input:** command, optional timeout, description
- **Risk:** High (can execute any command)
- **Notes:** Working directory persists, shell state does not

## Communication Tools

### AskUserQuestion
- **Purpose:** Ask the user interactive questions with options
- **Input:** questions array with options, headers, descriptions
- **Risk:** None (user interaction)
- **Notes:** Users can always select "Other" for custom input

### TodoWrite
- **Purpose:** Manage structured task lists
- **Input:** todos array with content, status, activeForm
- **Risk:** None (UI only)

## Agent Tools

### Task
- **Purpose:** Launch specialized sub-agents
- **Input:** prompt, subagent_type, optional model/max_turns
- **Risk:** Depends on agent configuration
- **Notes:** Agents run in isolated contexts

### Skill
- **Purpose:** Invoke skills (slash commands)
- **Input:** skill name, optional args
- **Risk:** Depends on skill

### ToolSearch
- **Purpose:** Discover and load deferred tools
- **Input:** query (keyword search or `select:tool_name`)
- **Risk:** None

## Web Tools

### WebFetch
- **Purpose:** Fetch and analyze web content
- **Input:** url, prompt
- **Risk:** None (read-only)
- **Notes:** Fails for authenticated URLs; use MCP tools instead

### WebSearch
- **Purpose:** Search the web
- **Input:** query, optional domain filters
- **Risk:** None (read-only)

## Specialized Tools

### NotebookEdit
- **Purpose:** Edit Jupyter notebook cells
- **Input:** notebook_path, cell_number, new_source
- **Risk:** Medium (modifies notebooks)

## MCP Tools

### Pattern: `mcp__{server}__{tool}`
- **Purpose:** Tools provided by MCP (Model Context Protocol) servers
- **Examples:**
  - `mcp__smartstack__validate_conventions`
  - `mcp__smartstack__scaffold_extension`
  - `mcp__context7__query-docs`
- **Risk:** Varies by tool
- **Notes:** Must be loaded via ToolSearch first if deferred

## Tool Selection Guide

### By Risk Level

| Risk | Tools |
|------|-------|
| None | Read, Glob, Grep, WebFetch, WebSearch, AskUserQuestion, TodoWrite, ToolSearch |
| Medium | Write, Edit, NotebookEdit |
| High | Bash |
| Variable | Task, Skill, mcp__* |

### By Use Case

| Use Case | Recommended Tools |
|----------|-------------------|
| Exploration / Research | Read, Glob, Grep, WebSearch |
| Code Generation | Read, Write, Edit, Glob, Grep |
| Full Development | Read, Write, Edit, Bash, Glob, Grep |
| Testing | Bash, Read, Glob, Grep |
| Documentation | Read, Write, Glob, Grep, WebFetch |
| Validation | Read, Glob, Grep, mcp__* |

### Principle of Least Privilege

Always give agents the minimum tools needed:

```yaml
# Too broad
tools: "Read, Write, Edit, Bash, Glob, Grep, WebFetch, WebSearch, Task, Skill"

# Just right for an explorer
tools: "Read, Grep, Glob"

# Just right for a code modifier
tools: "Read, Write, Edit, Glob, Grep"
```
