get_fund_industry_holding
Retrieve industry allocation data for a specific mutual fund to analyze its sector exposure and investment distribution across different industries.
Instructions
Get industry holding of a fund from stock market
Args:
symbol: str (symbol of the fund to get industry holding)
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:578-596 (handler)This is the main handler function for the MCP tool 'get_fund_industry_holding'. It is decorated with @server.tool(), which registers it as an MCP tool. The function fetches industry holdings data for a given fund symbol using vnstock's FMarketFund and returns it in json or dataframe format.@server.tool() def get_fund_industry_holding( symbol: str, output_format: Literal["json", "dataframe"] = "json" ): """ Get industry holding of a fund from stock market Args: symbol: str (symbol of the fund to get industry holding) output_format: Literal['json', 'dataframe'] = 'json' Returns: pd.DataFrame """ fund = FMarketFund() df = fund.details.industry_holding(symbol=symbol) if output_format == "json": return df.to_json(orient="records", force_ascii=False) else: return df