Skip to main content
Glama
ariesanhthu

VNStock MCP Server

by ariesanhthu

get_fund_industry_holding

Retrieve industry allocation data for mutual funds to analyze investment distribution across sectors in Vietnam's stock market.

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
NameRequiredDescriptionDefault
symbolYes
output_formatNojson

Implementation Reference

  • The handler function decorated with @server.tool(), which registers the tool and defines its schema via type hints and docstring. It retrieves the fund's industry holdings using the vnstock library's FMarketFund and returns the data 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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ariesanhthu/mcp-server-vietnam-stock-trading'

If you have feedback or need assistance with the MCP directory API, please join our Discord server