@langchain/anthropic package provides LangChain-compatible wrappers for Anthropic’s built-in tools. These tools can be bound to ChatAnthropic using bindTools() or createAgent.
Memory Tool
The memory tool (memory_20250818) enables Claude to store and retrieve information across conversations through a memory file directory. Claude can create, read, update, and delete files that persist between sessions, allowing it to build knowledge over time without keeping everything in the context window.
Web Search Tool
The web search tool (webSearch_20250305) gives Claude direct access to real-time web content, allowing it to answer questions with up-to-date information beyond its knowledge cutoff. Claude automatically cites sources from search results as part of its answer.
Web Fetch Tool
The web fetch tool (webFetch_20250910) allows Claude to retrieve full content from specified web pages and PDF documents. Claude can only fetch URLs that have been explicitly provided by the user or that come from previous web search or web fetch results.
⚠️ Security Warning: Enabling the web fetch tool in environments where Claude processes untrusted input alongside sensitive data poses data exfiltration risks. We recommend only using this tool in trusted environments or when handling non-sensitive data.
Tool Search Tools
The tool search tools enable Claude to work with hundreds or thousands of tools by dynamically discovering and loading them on-demand. This is useful when you have a large number of tools but don’t want to load them all into the context window at once. There are two variants:toolSearchRegex_20251119- Claude constructs regex patterns (using Python’sre.search()syntax) to search for toolstoolSearchBM25_20251119- Claude uses natural language queries to search for tools using the BM25 algorithm
Text Editor Tool
The text editor tool (textEditor_20250728) enables Claude to view and modify text files, helping debug, fix, and improve code or other text documents. Claude can directly interact with files, providing hands-on assistance rather than just suggesting changes.
Available commands:
view- Examine file contents or list directory contentsstr_replace- Replace specific text in a filecreate- Create a new file with specified contentinsert- Insert text at a specific line number
Computer Use Tool
The computer use tools enable Claude to interact with desktop environments through screenshot capture, mouse control, and keyboard input for autonomous desktop interaction.⚠️ Security Warning: Computer use is a beta feature with unique risks. Use a dedicated virtual machine or container with minimal privileges. Avoid giving access to sensitive data.There are two variants:
computer_20251124- For Claude Opus 4.5 (includes zoom capability)computer_20250124- For Claude 4 and Claude 3.7 models
screenshot- Capture the current screenleft_click,right_click,middle_click- Mouse clicks at coordinatesdouble_click,triple_click- Multi-click actionsleft_click_drag- Click and drag operationsleft_mouse_down,left_mouse_up- Granular mouse controlscroll- Scroll the screentype- Type textkey- Press keyboard keys/shortcutsmouse_move- Move the cursorhold_key- Hold a key while performing other actionswait- Wait for a specified durationzoom- View specific screen regions at full resolution (Claude Opus 4.5 only)
Code Execution Tool
The code execution tool (codeExecution_20250825) allows Claude to run Bash commands and manipulate files in a secure, sandboxed environment. Claude can analyze data, create visualizations, perform calculations, and process files.
When this tool is provided, Claude automatically gains access to:
- Bash commands - Execute shell commands for system operations
- File operations - Create, view, and edit files directly
Bash Tool
The bash tool (bash_20250124) enables shell command execution in a persistent bash session. Unlike the sandboxed code execution tool, this tool requires you to provide your own execution environment.
⚠️ Security Warning: The bash tool provides direct system access. Implement safety measures such as running in isolated environments (Docker/VM), command filtering, and resource limits.The bash tool provides:
- Persistent bash session - Maintains state between commands
- Shell command execution - Run any shell command
- Environment access - Access to environment variables and working directory
- Command chaining - Support for pipes, redirects, and scripting
- Execute a command:
{ command: "ls -la" } - Restart the session:
{ restart: true }
MCP Toolset
The MCP toolset (mcpToolset_20251120) enables Claude to connect to remote MCP (Model Context Protocol) servers directly from the Messages API without implementing a separate MCP client. This allows Claude to use tools provided by MCP servers.
Key features:
- Direct API integration - Connect to MCP servers without implementing an MCP client
- Tool calling support - Access MCP tools through the Messages API
- Flexible tool configuration - Enable all tools, allowlist specific tools, or denylist unwanted tools
- Per-tool configuration - Configure individual tools with custom settings
- OAuth authentication - Support for OAuth Bearer tokens for authenticated servers
- Multiple servers - Connect to multiple MCP servers in a single request