API: tools/news
better-web-search-mcp / tools/news
tools/news#
Interfaces#
NewsResponse#
Defined in: src/tools/news.ts:33
The spec-shaped web_news response.
Properties#
| Property | Type | Description | Defined in |
|---|---|---|---|
answer | string | - | src/tools/news.ts:34 |
queries_used | string[] | - | src/tools/news.ts:37 |
recency_verified | boolean | Whether every returned source carried a publication date inside the requested window. False means the results are topical but their age is unknown, which happens on the keyless path: DuckDuckGo’s HTML endpoint does not supply dates. An agent should not describe those as “from the last N days”. | src/tools/news.ts:48 |
sources | SearchSource[] | - | src/tools/news.ts:35 |
timeline | Record<string, SearchSource[]> | - | src/tools/news.ts:36 |
warnings? | string[] | Providers that refused or failed, so an empty result reads correctly. | src/tools/news.ts:39 |
Variables#
newsInputSchema#
constnewsInputSchema: {max_results:ZodDefault<ZodNumber>;recency_days:ZodDefault<ZodNumber>;topic:ZodString; }
Defined in: src/tools/news.ts:26
Input schema for web_news.
Type Declaration#
| Name | Type | Defined in |
|---|---|---|
max_results | ZodDefault<ZodNumber> | src/tools/news.ts:29 |
recency_days | ZodDefault<ZodNumber> | src/tools/news.ts:28 |
topic | ZodString | src/tools/news.ts:27 |
Functions#
registerNews()#
registerNews(
server,cache?):void
Defined in: src/tools/news.ts:191
Register the web_news tool on the given MCP server.
Parameters#
| Parameter | Type |
|---|---|
server | McpServer |
cache? | Cache |
Returns#
void
runNews()#
runNews(
args):Promise<NewsResponse>
Defined in: src/tools/news.ts:101
Run a recency-filtered news search and return the spec-shaped response.
Exported separately so tests and the smoke harness can call the handler logic directly.
Parameters#
| Parameter | Type |
|---|---|
args | { cache?: Cache; max_results?: number; recency_days?: number; topic: string; } |
args.cache? | Cache |
args.max_results? | number |
args.recency_days? | number |
args.topic | string |
Returns#
Promise<NewsResponse>