API: tools/news

better-web-search-mcp


better-web-search-mcp / tools/news

tools/news#

Interfaces#

NewsResponse#

Defined in: src/tools/news.ts:27

The spec-shaped web_news response.

Properties#

PropertyTypeDefined in
answerstringsrc/tools/news.ts:28
queries_usedstring[]src/tools/news.ts:31
sourcesSearchSource[]src/tools/news.ts:29
timelineRecord<string, SearchSource[]>src/tools/news.ts:30

Variables#

newsInputSchema#

const newsInputSchema: { max_results: ZodDefault<ZodNumber>; recency_days: ZodDefault<ZodNumber>; topic: ZodString; }

Defined in: src/tools/news.ts:20

Input schema for web_news.

Type Declaration#

NameTypeDefined in
max_resultsZodDefault<ZodNumber>src/tools/news.ts:23
recency_daysZodDefault<ZodNumber>src/tools/news.ts:22
topicZodStringsrc/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#

ParameterType
serverMcpServer
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#

ParameterType
args{ cache?: Cache; max_results?: number; recency_days?: number; topic: string; }
args.cache?Cache
args.max_results?number
args.recency_days?number
args.topicstring

Returns#

Promise<NewsResponse>