API: providers/tavily

better-web-search-mcp


better-web-search-mcp / providers/tavily

providers/tavily#

Classes#

TavilyProvider#

Defined in: src/providers/tavily.ts:26

Tavily Search provider (optional).

Requires TAVILY_API_KEY in the environment. When the key is missing or the request fails, it returns an empty array and logs a warning rather than throwing.

Implements#

Constructors#

Constructor#

new TavilyProvider(): TavilyProvider

Returns#

TavilyProvider

Properties#

PropertyModifierTypeDefault valueDescriptionDefined in
namereadonly"tavily""tavily"Stable provider identifier (e.g. “brave”, “tavily”, “duckduckgo”).src/providers/tavily.ts:27

Methods#

search(query, opts): Promise<SearchResult[]>

Defined in: src/providers/tavily.ts:29

Run a search and return normalized results.

Implementations MUST NOT throw on provider errors (missing key, HTTP 401/429, timeout). They return an empty array and log a warning instead, so one failing provider never breaks the aggregate search.

Parameters#
ParameterType
querystring
optsSearchOptions
Returns#

Promise<SearchResult[]>

Implementation of#

SearchProvider.search