API: providers/types

better-web-search-mcp


better-web-search-mcp / providers/types

providers/types#

Interfaces#

SearchOptions#

Defined in: src/providers/types.ts:27

Options controlling a single provider search.

Properties#

PropertyTypeDescriptionDefined in
count?numberMaximum number of results to request.src/providers/types.ts:29
extraSnippets?booleanRequest extra snippets from providers that support it (Brave).src/providers/types.ts:35
freshness?stringProvider-specific freshness filter (e.g. Brave “pd”/“pw”/“pm”/“py”).src/providers/types.ts:31
recency_days?numberNumber of days back to restrict results to.src/providers/types.ts:33

SearchProvider#

Defined in: src/providers/types.ts:39

A search provider that can be queried and returns normalized results.

Properties#

PropertyTypeDescriptionDefined in
namestringStable provider identifier (e.g. “brave”, “tavily”, “duckduckgo”).src/providers/types.ts:41

Methods#

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

Defined in: src/providers/types.ts:49

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[]>


SearchResult#

Defined in: src/providers/types.ts:11

A single normalized search result returned by any provider.

Extended by#

Properties#

PropertyTypeDescriptionDefined in
published?stringISO date string of publication, when the provider exposes it.src/providers/types.ts:19
score?numberA 0-1 relevance/quality score assigned by the provider, when available.src/providers/types.ts:21
snippetstringA short text snippet / description of the result.src/providers/types.ts:17
sourcestringThe name of the provider that produced this result.src/providers/types.ts:23
titlestringThe result title.src/providers/types.ts:13
urlstringThe canonical URL of the result.src/providers/types.ts:15