Skip to main content
The @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.
For more information, see Anthropic’s Memory Tool documentation.

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.
The web search tool supports several configuration options:
For more information, see Anthropic’s Web Search Tool documentation.

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.
The web fetch tool supports several configuration options:
You can combine web fetch with web search for comprehensive information gathering:
For more information, see Anthropic’s Web Fetch Tool documentation.

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’s re.search() syntax) to search for tools
  • toolSearchBM25_20251119 - Claude uses natural language queries to search for tools using the BM25 algorithm
Using the BM25 variant for natural language search:
For more information, see Anthropic’s Tool Search documentation.

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 contents
  • str_replace - Replace specific text in a file
  • create - Create a new file with specified content
  • insert - Insert text at a specific line number
For more information, see Anthropic’s Text Editor Tool documentation.

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
Available actions:
  • screenshot - Capture the current screen
  • left_click, right_click, middle_click - Mouse clicks at coordinates
  • double_click, triple_click - Multi-click actions
  • left_click_drag - Click and drag operations
  • left_mouse_down, left_mouse_up - Granular mouse control
  • scroll - Scroll the screen
  • type - Type text
  • key - Press keyboard keys/shortcuts
  • mouse_move - Move the cursor
  • hold_key - Hold a key while performing other actions
  • wait - Wait for a specified duration
  • zoom - View specific screen regions at full resolution (Claude Opus 4.5 only)
For Claude Opus 4.5 with zoom support:
For more information, see Anthropic’s Computer Use documentation.

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
Container reuse for multi-step workflows:
For more information, see Anthropic’s Code Execution Tool documentation.

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
Available commands:
  • Execute a command: { command: "ls -la" }
  • Restart the session: { restart: true }
For more information, see Anthropic’s Bash Tool documentation.

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
Allowlist pattern - Enable only specific tools:
Denylist pattern - Disable specific tools:
Multiple MCP servers:
With Tool Search - Use deferred loading for on-demand tool discovery:
For more information, see Anthropic’s MCP Connector documentation.