get_fund_asset_holding
Retrieve detailed asset holdings for specific funds in the Vietnam stock market. Use this tool to analyze fund portfolios by providing a fund symbol and choosing output format.
Instructions
Get asset holding of a fund from stock market
Args:
symbol: str (symbol of the fund to get asset 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:598-615 (handler)The handler function for the 'get_fund_asset_holding' tool, decorated with @server.tool() for MCP registration. It retrieves the asset holding data for a specified fund symbol using the FMarketFund class from the vnstock library and returns the result as either JSON or a pandas DataFrame based on the output_format parameter.@server.tool() def get_fund_asset_holding( symbol: str, output_format: Literal["json", "dataframe"] = "json" ): """ Get asset holding of a fund from stock market Args: symbol: str (symbol of the fund to get asset holding) output_format: Literal['json', 'dataframe'] = 'json' Returns: pd.DataFrame """ fund = FMarketFund() df = fund.details.asset_holding(symbol=symbol) if output_format == "json": return df.to_json(orient="records", force_ascii=False) else: return df
- src/vnstock_mcp/server.py:598-598 (registration)The @server.tool() decorator registers the get_fund_asset_holding function as an MCP tool.@server.tool()
- src/vnstock_mcp/server.py:605-608 (schema)Input schema defined in the function docstring and type hints: symbol (str), output_format (Literal["json", "dataframe"] = "json"). Output is pd.DataFrame or JSON string.symbol: str (symbol of the fund to get asset holding) output_format: Literal['json', 'dataframe'] = 'json' Returns: pd.DataFrame