get_ticker_news
Retrieve news articles for a specific stock ticker symbol to monitor market developments and inform investment decisions.
Instructions
Get news articles for a ticker
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ticker | Yes | Ticker symbol (e.g., AAPL) | |
| limit | No | Number of articles to return (default: 10) |
Implementation Reference
- src/index.ts:159-185 (handler)The handler function for get_ticker_news tool. Fetches news articles for a given ticker symbol using the Polygon API v2/reference/news endpoint. Returns formatted JSON response or error message.get_ticker_news: async (args: { ticker: string; limit?: number }) => { try { const params: any = { limit: args.limit || 10 }; const response = await polygonApi.get(`/v2/reference/news`, { params: { ...params, ticker: args.ticker } }); return { content: [{ type: "text", text: JSON.stringify(response.data, null, 2) }] }; } catch (error: any) { return { content: [{ type: "text", text: `Error getting ticker news: ${error.response?.data?.message || error.message}` }], isError: true }; } },
- src/index.ts:338-355 (registration)Tool registration in the ListTools response, defining the name, description, and input schema for get_ticker_news.{ name: "get_ticker_news", description: "Get news articles for a ticker", inputSchema: { type: "object", properties: { ticker: { type: "string", description: "Ticker symbol (e.g., AAPL)" }, limit: { type: "number", description: "Number of articles to return (default: 10)" } }, required: ["ticker"] } },
- src/index.ts:341-354 (schema)Input schema definition for the get_ticker_news tool, specifying parameters ticker (required string) and optional limit (number).inputSchema: { type: "object", properties: { ticker: { type: "string", description: "Ticker symbol (e.g., AAPL)" }, limit: { type: "number", description: "Number of articles to return (default: 10)" } }, required: ["ticker"] }