Skip to main content
Glama
ariesanhthu

VNStock MCP Server

by ariesanhthu

get_fund_top_holding

Retrieve the top holdings of a specific fund in the Vietnam stock market. Provide the fund symbol to get detailed holding information 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
NameRequiredDescriptionDefault
symbolYes
output_formatNojson

Implementation Reference

  • The main handler function for the 'get_fund_top_holding' MCP tool. It is registered via @server.tool() decorator, defines input schema via type hints, fetches top holdings using vnstock FMarketFund.details.top_holding(), and returns data as JSON or pandas DataFrame.
    @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
  • Creation of the FastMCP server instance where all tools including get_fund_top_holding are registered via decorators.
    server = FastMCP("VNStock MCP Server")
  • Import of FMarketFund class used in the tool handler to fetch fund details.
    from vnstock.explorer.fmarket.fund import Fund as FMarketFund

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