search_news
Search news articles by query and date range to find relevant information from aggregated sources.
Instructions
Search news articles
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| from_date | No | ||
| to_date | No |
Implementation Reference
- src/apis/news/newsapi.ts:83-90 (handler)The handler function that implements the core logic of the 'search_news' tool. It validates the API key and query parameter, extracts optional date parameters, and delegates to the NewsApiClient's search method.async search_news(args: Record<string, unknown>) { if (!cfg.newsApiKey) throw new Error("NEWS_API_KEY is not configured"); const query = String(args.query || ""); if (!query) throw new Error("query is required"); const from_date = args.from_date ? String(args.from_date) : undefined; const to_date = args.to_date ? String(args.to_date) : undefined; return client.search(query, from_date, to_date); },
- src/apis/news/newsapi.ts:54-62 (schema)The input schema for the 'search_news' tool, specifying a required 'query' string and optional 'from_date' and 'to_date' strings.inputSchema: { type: "object", properties: { query: { type: "string" }, from_date: { type: "string" }, to_date: { type: "string" }, }, required: ["query"], },
- src/apis/news/newsapi.ts:51-63 (registration)The tool registration object for 'search_news' within the registerNewsApi() function, which includes name, description, and input schema.{ name: "search_news", description: "Search news articles", inputSchema: { type: "object", properties: { query: { type: "string" }, from_date: { type: "string" }, to_date: { type: "string" }, }, required: ["query"], }, },
- src/tools/register.ts:25-25 (registration)Invocation of registerNewsApi() in the central registerAllTools() function, which includes the 'search_news' tool among others.registerNewsApi(),