get_snapshot
Retrieve current market data snapshots for specified stock tickers to analyze real-time financial performance and trading metrics.
Instructions
Get snapshot of ticker(s)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tickers | Yes | Comma-separated list of tickers (e.g., AAPL,MSFT,GOOGL) |
Implementation Reference
- src/index.ts:215-237 (handler)The async handler function implementing the 'get_snapshot' tool logic. It calls the Polygon API to retrieve snapshot data for given tickers and formats the response as text content or handles errors.get_snapshot: async (args: { tickers: string }) => { try { const response = await polygonApi.get('/v2/snapshot/locale/us/markets/stocks/tickers', { params: { tickers: args.tickers } }); return { content: [{ type: "text", text: JSON.stringify(response.data, null, 2) }] }; } catch (error: any) { return { content: [{ type: "text", text: `Error getting snapshot: ${error.response?.data?.message || error.message}` }], isError: true }; } }
- src/index.ts:386-395 (schema)The input schema definition for the 'get_snapshot' tool, specifying the required 'tickers' parameter as a string.inputSchema: { type: "object", properties: { tickers: { type: "string", description: "Comma-separated list of tickers (e.g., AAPL,MSFT,GOOGL)" } }, required: ["tickers"] }
- src/index.ts:384-396 (registration)The tool registration entry in the ListTools response, including name, description, and input schema for 'get_snapshot'.name: "get_snapshot", description: "Get snapshot of ticker(s)", inputSchema: { type: "object", properties: { tickers: { type: "string", description: "Comma-separated list of tickers (e.g., AAPL,MSFT,GOOGL)" } }, required: ["tickers"] } }