API: tools/news
better-web-search-mcp / tools/news
tools/news#
Interfaces#
NewsResponse#
Defined in: src/tools/news.ts:27
The spec-shaped web_news response.
Properties#
| Property | Type | Defined in |
|---|---|---|
answer | string | src/tools/news.ts:28 |
queries_used | string[] | src/tools/news.ts:31 |
sources | SearchSource[] | src/tools/news.ts:29 |
timeline | Record<string, SearchSource[]> | src/tools/news.ts:30 |
Variables#
newsInputSchema#
constnewsInputSchema: {max_results:ZodDefault<ZodNumber>;recency_days:ZodDefault<ZodNumber>;topic:ZodString; }
Defined in: src/tools/news.ts:20
Input schema for web_news.
Type Declaration#
| Name | Type | Defined in |
|---|---|---|
max_results | ZodDefault<ZodNumber> | src/tools/news.ts:23 |
recency_days | ZodDefault<ZodNumber> | src/tools/news.ts:22 |
topic | ZodString | src/tools/news.ts:21 |
Functions#
registerNews()#
registerNews(
server,cache?):void
Defined in: src/tools/news.ts:149
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:84
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>