Tool Calls
Tool Calls
Tools are code functions that an agent is aware of and can invoke to complete their tasks. Tools often call out to external programs, letting the agent interact outside its environment and predefined knowledge.
Examples by agentic loop phase:
- Gather Context: file readers, search APIs, database queries, codebase scanners, system state queries. E.g.
read_file("tests/test_payment.py") - Take Action: code editing, running commands, writing files, calling APIs, executing scripts. E.g.
edit_file("src/payment.py", change="fix tax calculation") - Verify Results: run tests, compile code, query output, inspect logs, compare results. E.g.
run_command("pytest")
Claude Code's built-in tools fall into five categories:
- File operations — read files, edit code, create new files, rename and reorganize
- Search/Find — searches files by pattern, search content with regex, explore codebases
- Execution/Run — executes shell commands, start servers, run tests, use git
- Web Search — searches the web, fetch documentation, look up error messages
- Code intelligence — looks at type errors and warnings after edits, jump to definitions
Related: Agentic Loop