get_latest_quote
Retrieve real-time stock quotes for any ticker symbol to access current market prices and trading data.
Instructions
Get real-time quote for a ticker
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ticker | Yes | Ticker symbol (e.g., AAPL) |
Implementation Reference
- src/index.ts:62-80 (handler)The handler function for get_latest_quote tool. Fetches the latest NBBO quote from Polygon API for the specified ticker and returns the JSON response or an error message.get_latest_quote: async (args: { ticker: string }) => { try { const response = await polygonApi.get(`/v2/last/nbbo/${args.ticker}`); return { content: [{ type: "text", text: JSON.stringify(response.data, null, 2) }] }; } catch (error: any) { return { content: [{ type: "text", text: `Error getting latest quote: ${error.response?.data?.message || error.message}` }], isError: true }; } },
- src/index.ts:258-271 (registration)Tool registration in the ListTools handler, specifying name, description, and input schema for get_latest_quote.{ name: "get_latest_quote", description: "Get real-time quote for a ticker", inputSchema: { type: "object", properties: { ticker: { type: "string", description: "Ticker symbol (e.g., AAPL)" } }, required: ["ticker"] } },
- src/index.ts:261-270 (schema)Input schema definition for the get_latest_quote tool, requiring a 'ticker' string parameter.inputSchema: { type: "object", properties: { ticker: { type: "string", description: "Ticker symbol (e.g., AAPL)" } }, required: ["ticker"] }