Type 'TavilySearch' from "@langchain/tavily" is not assignable to type 'ServerTool | ClientTool' and can't be used in createReactAgent method #331

Closed
opened 2026-02-15 18:15:58 -05:00 by yindo · 1 comment
Owner

Originally created by @pavlo-tkhir on GitHub (Aug 6, 2025).

Checked other resources

  • I added a very descriptive title to this issue.
  • I searched the LangGraph.js documentation with the integrated search.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in LangGraph.js rather than my code.
  • The bug is not resolved by updating to the latest stable version of LangGraph (or the specific integration package).

Example Code

import { createReactAgent } from "@langchain/langgraph/prebuilt";
import { TavilySearch } from "@langchain/tavily";
import { ChatOpenAI } from "@langchain/openai";

const model = new ChatOpenAI({
  model: "gpt-4o",
});

const tavily = new TavilySearch({ maxResults: 3 });

const agent = createReactAgent({
  llm: model,
  tools: [tavily], // Type 'TavilySearch' is not assignable to type 'ServerTool | ClientTool'.
  prompt: `
  You are a helpful assistant that can search the web for information.
  `,
});

Error Message and Stack Trace (if applicable)

Type 'TavilySearch' is not assignable to type 'ServerTool | ClientTool'.
Type 'TavilySearch' is not assignable to type 'ServerTool'.
Index signature for type 'string' is missing in type 'TavilySearch'.

Description

TavilySearch class from "@langchain/tavily" can't be used in createReactAgent as a tool because of the following cast issue:

Type 'TavilySearch' is not assignable to type 'ServerTool | ClientTool'.
Type 'TavilySearch' is not assignable to type 'ServerTool'.
Index signature for type 'string' is missing in type 'TavilySearch'.

"@langchain/tavily": "^0.1.4",
"@langchain/core": "^0.3.66",

System Info

Node version: v20.19.1
Operating system: darwin arm64
Package manager: pnpm
Package manager version: 10.11.0

Originally created by @pavlo-tkhir on GitHub (Aug 6, 2025). ### Checked other resources - [x] I added a very descriptive title to this issue. - [x] I searched the LangGraph.js documentation with the integrated search. - [x] I used the GitHub search to find a similar question and didn't find it. - [x] I am sure that this is a bug in LangGraph.js rather than my code. - [x] The bug is not resolved by updating to the latest stable version of LangGraph (or the specific integration package). ### Example Code ```typescript import { createReactAgent } from "@langchain/langgraph/prebuilt"; import { TavilySearch } from "@langchain/tavily"; import { ChatOpenAI } from "@langchain/openai"; const model = new ChatOpenAI({ model: "gpt-4o", }); const tavily = new TavilySearch({ maxResults: 3 }); const agent = createReactAgent({ llm: model, tools: [tavily], // Type 'TavilySearch' is not assignable to type 'ServerTool | ClientTool'. prompt: ` You are a helpful assistant that can search the web for information. `, }); ``` ### Error Message and Stack Trace (if applicable) Type 'TavilySearch' is not assignable to type 'ServerTool | ClientTool'. Type 'TavilySearch' is not assignable to type 'ServerTool'. Index signature for type 'string' is missing in type 'TavilySearch'. ### Description TavilySearch class from "@langchain/tavily" can't be used in createReactAgent as a tool because of the following cast issue: Type 'TavilySearch' is not assignable to type 'ServerTool | ClientTool'. Type 'TavilySearch' is not assignable to type 'ServerTool'. Index signature for type 'string' is missing in type 'TavilySearch'. "@langchain/tavily": "^0.1.4", "@langchain/core": "^0.3.66", ### System Info Node version: v20.19.1 Operating system: darwin arm64 Package manager: pnpm Package manager version: 10.11.0
yindo closed this issue 2026-02-15 18:15:58 -05:00
Author
Owner

@dqbd commented on GitHub (Aug 6, 2025):

Fixed in @langchain/tavily 0.1.5!

@dqbd commented on GitHub (Aug 6, 2025): Fixed in `@langchain/tavily` 0.1.5!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraphjs#331