get_company_shareholders
Retrieve shareholder information for Vietnam-listed companies using stock symbols. Returns data in JSON or DataFrame format for analysis.
Instructions
Get company shareholders from stock market
Args:
symbol: str
output_format: Literal['json', 'dataframe'] = 'json'
Returns:
pd.DataFrame
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | Yes | ||
| output_format | No | json |
Implementation Reference
- src/vnstock_mcp/server.py:93-110 (handler)The core handler function for the 'get_company_shareholders' tool. It fetches shareholder data for a given company symbol using the TCBSCompany class from the vnstock library and returns the result as either JSON or a pandas DataFrame. The function is automatically registered as an MCP tool via the @server.tool() decorator.@server.tool() def get_company_shareholders( symbol: str, output_format: Literal["json", "dataframe"] = "json" ): """ Get company shareholders from stock market Args: symbol: str output_format: Literal['json', 'dataframe'] = 'json' Returns: pd.DataFrame """ equity = TCBSCompany(symbol=symbol) df = equity.shareholders() if output_format == "json": return df.to_json(orient="records", force_ascii=False) else: return df