Skip to main content
Glama
berlinbra

AlphaVantage-MCP

get-company-info

Retrieve detailed company information using stock symbols to access financial data and company profiles for investment research and analysis.

Instructions

Get detailed company information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYesStock symbol (e.g., AAPL, MSFT)

Implementation Reference

  • The handler logic for executing the 'get-company-info' tool. Validates input, fetches company overview data from Alpha Vantage API using 'OVERVIEW' function, formats the response, and returns structured text content.
    elif name == "get-company-info": symbol = arguments.get("symbol") if not symbol: return [types.TextContent(type="text", text="Missing symbol parameter")] symbol = symbol.upper() async with httpx.AsyncClient() as client: company_data = await make_alpha_request( client, "OVERVIEW", symbol ) if isinstance(company_data, str): return [types.TextContent(type="text", text=f"Error: {company_data}")] formatted_info = format_company_info(company_data) info_text = f"Company information for {symbol}:\n\n{formatted_info}" return [types.TextContent(type="text", text=info_text)]
  • Registration of the 'get-company-info' tool in the list_tools handler, including name, description, and JSON schema for input validation (requires 'symbol' string).
    types.Tool( name="get-company-info", description="Get detailed company information", inputSchema={ "type": "object", "properties": { "symbol": { "type": "string", "description": "Stock symbol (e.g., AAPL, MSFT)", }, }, "required": ["symbol"], }, ),
  • Input schema definition for the 'get-company-info' tool as part of its registration.
    types.Tool( name="get-company-info", description="Get detailed company information", inputSchema={ "type": "object", "properties": { "symbol": { "type": "string", "description": "Stock symbol (e.g., AAPL, MSFT)", }, }, "required": ["symbol"], }, ),
  • Helper function specifically for formatting company overview data into a human-readable string, extracting key fields like name, sector, industry, market cap, description, exchange, and currency.
    def format_company_info(overview_data: Dict[str, Any]) -> str: """Format company information into a concise string. Args: overview_data: The response data from the Alpha Vantage OVERVIEW endpoint Returns: A formatted string containing the company information """ try: if not overview_data: return "No company information available in the response" return ( f"Name: {overview_data.get('Name', 'N/A')}\n" f"Sector: {overview_data.get('Sector', 'N/A')}\n" f"Industry: {overview_data.get('Industry', 'N/A')}\n" f"Market Cap: ${overview_data.get('MarketCapitalization', 'N/A')}\n" f"Description: {overview_data.get('Description', 'N/A')}\n" f"Exchange: {overview_data.get('Exchange', 'N/A')}\n" f"Currency: {overview_data.get('Currency', 'N/A')}\n" "---" ) except Exception as e: return f"Error formatting company data: {str(e)}"

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/berlinbra/alpha-vantage-mcp'

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