get_company_info
Retrieve company name, country, sector, and market cap for a BRVM-listed stock by providing its ticker symbol.
Instructions
Get detailed information about a BRVM-listed company.
Args: ticker: The BRVM ticker symbol.
Returns company name, country, sector, and market cap.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ticker | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/brvm_mcp/server.py:178-195 (handler)The MCP tool handler function 'get_company_info' — decorated with @mcp.tool(). Accepts a ticker string, calls scraper.get_company_info(ticker), and returns JSON with company name, country, sector, and market cap.
@mcp.tool() async def get_company_info(ticker: str) -> str: """ Get detailed information about a BRVM-listed company. Args: ticker: The BRVM ticker symbol. Returns company name, country, sector, and market cap. """ assert scraper info = await scraper.get_company_info(ticker) if not info: return json.dumps( {"error": f"Company '{ticker}' not found. Use search_stocks to browse available companies."} ) return json.dumps(info.model_dump(), ensure_ascii=False, indent=2) - The scraper method 'get_company_info' that looks up the ticker in TICKER_REGISTRY, fetches a live quote, and constructs a CompanyInfo object.
async def get_company_info(self, ticker: str) -> CompanyInfo | None: """Get static company info, enriched from registry + live data.""" ticker = ticker.upper().strip() registry = TICKER_REGISTRY.get(ticker) if not registry: return None quote = await self.get_quote(ticker) return CompanyInfo( ticker=ticker, name=registry[0], country=registry[1], sector=registry[2], market_cap=quote.market_cap if quote else None, ) - The CompanyInfo Pydantic model used as the return type for company info — includes ticker, name, country, sector, listing_section, isin, market_cap, description.
class CompanyInfo(BaseModel): """Static company information.""" ticker: str name: str country: str sector: str listing_section: str = Field("", description="BRVM listing section (1st or 2nd)") isin: str = Field("", description="ISIN code if available") market_cap: float | None = None description: str = "" - src/brvm_mcp/server.py:69-69 (registration)The FastMCP server instance 'mcp' to which 'get_company_info' is registered via the @mcp.tool() decorator.
mcp = FastMCP( - The TICKER_REGISTRY dictionary that maps ticker symbols to (company_name, country, sector) tuples, which the scraper's get_company_info uses to enrich the response.
TICKER_REGISTRY: dict[str, tuple[str, str, str]] = { "ABJC": ("Servair Abidjan Côte d'Ivoire", "Côte d'Ivoire", "Distribution"), "BICB": ("BIIC Bénin", "Bénin", "Services Financiers"), "BICC": ("BICI Côte d'Ivoire", "Côte d'Ivoire", "Services Financiers"), "BNBC": ("Bernabé Côte d'Ivoire", "Côte d'Ivoire", "Distribution"), "BOAB": ("Bank of Africa Bénin", "Bénin", "Services Financiers"), "BOABF": ("Bank of Africa Burkina Faso", "Burkina Faso", "Services Financiers"), "BOAC": ("Bank of Africa Côte d'Ivoire", "Côte d'Ivoire", "Services Financiers"), "BOAM": ("Bank of Africa Mali", "Mali", "Services Financiers"), "BOAN": ("Bank of Africa Niger", "Niger", "Services Financiers"), "BOAS": ("Bank of Africa Sénégal", "Sénégal", "Services Financiers"), "CABC": ("Sicable Côte d'Ivoire", "Côte d'Ivoire", "Industrie"), "CBIBF": ("Coris Bank International", "Burkina Faso", "Services Financiers"), "CFAC": ("CFAO Motors Côte d'Ivoire", "Côte d'Ivoire", "Distribution"), "CIEC": ("CIE Côte d'Ivoire", "Côte d'Ivoire", "Services Publics"), "ECOC": ("Ecobank Côte d'Ivoire", "Côte d'Ivoire", "Services Financiers"), "ETIT": ("Ecobank Transnational Inc.", "Togo", "Services Financiers"), "FTSC": ("Filtisac Côte d'Ivoire", "Côte d'Ivoire", "Industrie"), "LNBB": ("Loterie Nationale du Bénin", "Bénin", "Distribution"), "NEIC": ("NEI-CEDA Côte d'Ivoire", "Côte d'Ivoire", "Distribution"), "NSBC": ("NSIA Banque Côte d'Ivoire", "Côte d'Ivoire", "Services Financiers"), "NTLC": ("Nestlé Côte d'Ivoire", "Côte d'Ivoire", "Industrie"), "ONTBF": ("Onatel Burkina Faso", "Burkina Faso", "Services Publics"), "ORAC": ("Orange Côte d'Ivoire", "Côte d'Ivoire", "Services Publics"), "ORGT": ("Oragroup Togo", "Togo", "Services Financiers"), "PALC": ("Palm Côte d'Ivoire", "Côte d'Ivoire", "Agriculture"), "PRSC": ("Tractafric Motors Côte d'Ivoire", "Côte d'Ivoire", "Distribution"), "SAFC": ("Safca Côte d'Ivoire", "Côte d'Ivoire", "Services Financiers"), "SCRC": ("Sucrivoire Côte d'Ivoire", "Côte d'Ivoire", "Agriculture"), "SDCC": ("SODE Côte d'Ivoire", "Côte d'Ivoire", "Services Publics"), "SDSC": ("Bolloré Transport & Logistics", "Côte d'Ivoire", "Transport"), "SEMC": ("Eviosys Packaging SIEM", "Côte d'Ivoire", "Industrie"), "SGBC": ("Société Générale CI", "Côte d'Ivoire", "Services Financiers"), "SHEC": ("Vivo Energy Côte d'Ivoire", "Côte d'Ivoire", "Distribution"), "SIBC": ("Société Ivoirienne de Banque", "Côte d'Ivoire", "Services Financiers"), "SICC": ("Sicor Côte d'Ivoire", "Côte d'Ivoire", "Agriculture"), "SIVC": ("Air Liquide Côte d'Ivoire", "Côte d'Ivoire", "Industrie"), "SLBC": ("Solibra Côte d'Ivoire", "Côte d'Ivoire", "Industrie"), "SMBC": ("SMB Côte d'Ivoire", "Côte d'Ivoire", "Industrie"), "SNTS": ("Sonatel Sénégal", "Sénégal", "Services Publics"), "SOGC": ("Sogb Côte d'Ivoire", "Côte d'Ivoire", "Agriculture"), "SPHC": ("SAPH Côte d'Ivoire", "Côte d'Ivoire", "Agriculture"), "STAC": ("Setao Côte d'Ivoire", "Côte d'Ivoire", "Industrie"), "STBC": ("Sitab Côte d'Ivoire", "Côte d'Ivoire", "Industrie"), "TTLC": ("Total Énergies CI", "Côte d'Ivoire", "Distribution"), "TTLS": ("Total Énergies Sénégal", "Sénégal", "Distribution"), "UNLC": ("Unilever Côte d'Ivoire", "Côte d'Ivoire", "Industrie"), "UNXC": ("Uniwax Côte d'Ivoire", "Côte d'Ivoire", "Industrie"), }