Skip to main content
Glama
jwaresolutions

Polygon MCP Server

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
NameRequiredDescriptionDefault
tickerYesTicker symbol (e.g., AAPL)

Implementation Reference

  • 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"]
      }
    },
  • 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"]
    }

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/jwaresolutions/polygon-mcp-server'

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