API: providers/types
better-web-search-mcp / providers/types
providers/types#
Interfaces#
SearchOptions#
Defined in: src/providers/types.ts:27
Options controlling a single provider search.
Properties#
| Property | Type | Description | Defined in |
|---|---|---|---|
count? | number | Maximum number of results to request. | src/providers/types.ts:29 |
extraSnippets? | boolean | Request extra snippets from providers that support it (Brave). | src/providers/types.ts:35 |
freshness? | string | Provider-specific freshness filter (e.g. Brave “pd”/“pw”/“pm”/“py”). | src/providers/types.ts:31 |
recency_days? | number | Number 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#
| Property | Type | Description | Defined in |
|---|---|---|---|
name | string | Stable provider identifier (e.g. “brave”, “tavily”, “duckduckgo”). | src/providers/types.ts:41 |
Methods#
search()#
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#
| Parameter | Type |
|---|---|
query | string |
opts | SearchOptions |
Returns#
Promise<SearchResult[]>
SearchResult#
Defined in: src/providers/types.ts:11
A single normalized search result returned by any provider.
Extended by#
Properties#
| Property | Type | Description | Defined in |
|---|---|---|---|
published? | string | ISO date string of publication, when the provider exposes it. | src/providers/types.ts:19 |
score? | number | A 0-1 relevance/quality score assigned by the provider, when available. | src/providers/types.ts:21 |
snippet | string | A short text snippet / description of the result. | src/providers/types.ts:17 |
source | string | The name of the provider that produced this result. | src/providers/types.ts:23 |
title | string | The result title. | src/providers/types.ts:13 |
url | string | The canonical URL of the result. | src/providers/types.ts:15 |