get_fund_top_holding
Retrieve the top holdings of a Vietnam stock market fund by providing its symbol, with output available in JSON or dataframe format.
Instructions
Get top holding of a fund from stock market
Args:
symbol: str (symbol of the fund to get top 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:558-575 (handler)The handler function for the 'get_fund_top_holding' MCP tool. It is decorated with @server.tool() which registers it automatically in the FastMCP server. The function wraps FMarketFund.details.top_holding() to fetch the top holdings of a fund and returns the result as JSON or pandas DataFrame based on the output_format parameter.@server.tool() def get_fund_top_holding( symbol: str, output_format: Literal["json", "dataframe"] = "json" ): """ Get top holding of a fund from stock market Args: symbol: str (symbol of the fund to get top holding) output_format: Literal['json', 'dataframe'] = 'json' Returns: pd.DataFrame """ fund = FMarketFund() df = fund.details.top_holding(symbol=symbol) if output_format == "json": return df.to_json(orient="records", force_ascii=False) else: return df