Overview
Integration details
Tool features
Setup
The integration lives in the@langchain/tavily package, which you can install as shown below:
Credentials
Set up a Tavily API key and set it as an environment variable namedTAVILY_API_KEY.
Instantiation
The tool accepts the following parameters during instantiation:maxDepth(optional, number): Maximum number of hops from the starting URL. Default is3.maxBreadth(optional, number): Maximum number of pages to crawl per level. Default is50.limit(optional, number): Maximum total number of pages to crawl. Default is100.instructions(optional, string): Natural-language instructions that guide the crawler.selectPaths(optional, string[]): Only crawl URLs containing these path regexes.selectDomains(optional, string[]): Only crawl these domain regexes.excludePaths(optional, string[]): Skip URLs containing these path regexes.excludeDomains(optional, string[]): Skip URLs from these domain regexes.allowExternal(optional, boolean): Allow the crawler to follow external links.extractDepth(optional, string):"basic"or"advanced"extraction depth for each crawled page. Default is"basic".format(optional, string):"markdown"or"text"content format. Default is"markdown".includeImages(optional, boolean): Include images discovered on each page. Default isfalse.
Invocation
Invoke directly with args
The Tavily crawl tool accepts the following arguments during invocation:url(required): The base URL to start crawling from.- The following arguments can also be set during invocation:
instructions,selectPaths,selectDomains,excludePaths,excludeDomains,allowExternal.
Invoke with ToolCall
We can also invoke the tool with a model-generatedToolCall, in which case a ToolMessage will be returned:
Use within an agent
We can use the crawl tool directly with a LangChain agent by passing it tocreateAgent. The agent can dynamically set url, instructions, and the path/domain filters as part of its tool call.
API reference
For detailed documentation of all Tavily Crawl API features and configurations head to the API reference: docs.tavily.com/documentation/api-reference/endpoint/crawlConnect these docs to Claude, VSCode, and more via MCP for real-time answers.

