Skip to main content
Glama
ariesanhthu

VNStock MCP Server

by ariesanhthu

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

Implementation Reference

  • 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
  • The @server.tool() decorator registers the get_fund_asset_holding function as an MCP tool.
    @server.tool()
  • 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
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions the return type ('pd.DataFrame') but doesn't describe what data the DataFrame contains, whether there are rate limits, authentication requirements, or potential errors. For a financial data tool with zero annotation coverage, this leaves significant behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately concise with three clear sections: purpose statement, arguments, and returns. Each sentence serves a distinct purpose without redundancy. The structure with labeled sections ('Args:', 'Returns:') aids readability, though it could be more front-loaded with the core purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 2 parameters with 0% schema coverage and no output schema, the description provides basic parameter documentation and return type but lacks details on data format, error conditions, and behavioral constraints. For a financial data retrieval tool with multiple sibling alternatives, this leaves the agent with incomplete context about what exactly is returned and how it differs from similar tools.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It documents both parameters: 'symbol' (fund symbol) and 'output_format' (with enum values and default). However, it doesn't explain symbol format requirements, what 'dataframe' output entails versus 'json', or provide examples. The description adds basic semantics but doesn't fully compensate for the schema coverage gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Get asset holding of a fund from stock market' - this specifies the verb ('Get'), resource ('asset holding'), and domain ('fund from stock market'). It distinguishes from siblings like 'get_fund_industry_holding' or 'get_fund_top_holding' by focusing on general asset holdings rather than specific breakdowns. However, it doesn't explicitly contrast with these alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. While it's clear this retrieves fund asset holdings, there's no mention of when to choose this over 'get_fund_industry_holding' or 'get_fund_top_holding', nor any prerequisites or context for usage. The agent must infer usage from the name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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