Skip to main content
Glama
deepsuthar496

Alpha Vantage MCP Server

get_stock_price

Retrieve real-time stock price data by inputting the stock symbol, enabling immediate access to market information through Alpha Vantage's financial API integration.

Instructions

Get real-time stock price information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYesThe stock symbol (e.g., AAPL)

Implementation Reference

  • The main handler function that executes the get_stock_price tool logic by querying the Alpha Vantage GLOBAL_QUOTE API endpoint and returning the response as formatted JSON text.
    private async getStockPrice(args: any) { const response = await this.axiosInstance.get('', { params: { function: 'GLOBAL_QUOTE', symbol: args.symbol, }, }); return { content: [ { type: 'text', text: JSON.stringify(response.data, null, 2), }, ], }; }
  • Input schema definition for the get_stock_price tool, specifying an object with a required 'symbol' string property.
    inputSchema: { type: 'object', properties: { symbol: { type: 'string', description: 'The stock symbol (e.g., AAPL)', }, }, required: ['symbol'], },
  • src/index.ts:93-106 (registration)
    Registration of the get_stock_price tool in the ListToolsRequestHandler, providing name, description, and input schema.
    { name: 'get_stock_price', description: 'Get real-time stock price information', inputSchema: { type: 'object', properties: { symbol: { type: 'string', description: 'The stock symbol (e.g., AAPL)', }, }, required: ['symbol'], }, },
  • src/index.ts:53-54 (registration)
    Routing logic in the CallToolRequestHandler switch statement that dispatches to the getStockPrice handler.
    case 'get_stock_price': return await this.getStockPrice(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/deepsuthar496/alpha-ventage-mcp'

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