Skip to main content
Glama
MCP-100

Stock Market MCP Server

by MCP-100

get_ticker_price

Fetch real-time stock prices using a ticker symbol with this tool, enabling quick access to up-to-date market data for informed decision-making.

Instructions

Get current price for a stock ticker

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYesStock ticker symbol

Implementation Reference

  • The main handler function for the 'get_ticker_price' tool. It makes an API call to Alpha Vantage for intraday time series data and extracts the latest open price.
    private async handleGetTickerPrice(args: any) { const response = await this.axiosInstance.get('', { params: { function: 'TIME_SERIES_INTRADAY', symbol: args.symbol, interval: '1min', outputsize: 'compact' } }); const latestData = response.data['Time Series (1min)']; const latestTimestamp = Object.keys(latestData)[0]; const price = latestData[latestTimestamp]['1. open']; return { content: [{ type: 'text', text: JSON.stringify({ symbol: args.symbol, price: price, timestamp: latestTimestamp }, null, 2) }] }; }
  • Input schema definition for the 'get_ticker_price' tool, specifying a required 'symbol' string parameter.
    inputSchema: { type: 'object', properties: { symbol: { type: 'string', description: 'Stock ticker symbol' } }, required: ['symbol'] }
  • src/index.ts:53-66 (registration)
    Tool registration in the ListTools response, including name, description, and schema.
    { name: 'get_ticker_price', description: 'Get current price for a stock ticker', inputSchema: { type: 'object', properties: { symbol: { type: 'string', description: 'Stock ticker symbol' } }, required: ['symbol'] } },
  • src/index.ts:114-115 (registration)
    Dispatch case in the CallToolRequestHandler that routes to the specific handler.
    case 'get_ticker_price': return await this.handleGetTickerPrice(request.params.arguments);

Other Tools

Related Tools

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/MCP-100/stock-market-server'

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