Skip to main content
Glama

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
NameRequiredDescriptionDefault
queryYes
from_dateNo
to_dateNo

Implementation Reference

  • 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); },
  • 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"], },
  • 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"], }, },
  • Invocation of registerNewsApi() in the central registerAllTools() function, which includes the 'search_news' tool among others.
    registerNewsApi(),

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/TaylorChen/muti-mcps'

If you have feedback or need assistance with the MCP directory API, please join our Discord server