Skip to main content
Glama
ariesanhthu

VNStock MCP Server

by ariesanhthu

search_fund

Search for mutual funds in the Vietnam stock market by name using partial matching and retrieve results in JSON or DataFrame format.

Instructions

Search fund by name from stock market
Args:
    keyword: str (partial match for fund name to search)
    output_format: Literal['json', 'dataframe'] = 'json'
Returns:
    pd.DataFrame

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keywordYes
output_formatNojson

Implementation Reference

  • The main handler function for the 'search_fund' tool, decorated with @server.tool() for registration in FastMCP. It searches funds using FMarketFund.filter and returns data in JSON or DataFrame format.
    @server.tool()
    def search_fund(keyword: str, output_format: Literal["json", "dataframe"] = "json"):
        """
        Search fund by name from stock market
        Args:
            keyword: str (partial match for fund name to search)
            output_format: Literal['json', 'dataframe'] = 'json'
        Returns:
            pd.DataFrame
        """
        fund = FMarketFund()
        df = fund.filter(symbol=keyword)
        if output_format == "json":
            return df.to_json(orient="records", force_ascii=False)
        else:
            return df
  • The @server.tool() decorator registers the search_fund function as an MCP tool named 'search_fund'.
    @server.tool()
  • Docstring and type hints define the input schema (keyword: str, output_format: Literal) and output (pd.DataFrame or JSON).
    """
    Search fund by name from stock market
    Args:
        keyword: str (partial match for fund name to search)
        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 but lacks behavioral details. It mentions partial matching for the keyword and return type (pd.DataFrame), but doesn't cover error handling, rate limits, authentication needs, or what happens with no results. For a search tool with zero annotation coverage, this is insufficient.

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 sized and front-loaded with the core purpose, followed by parameter and return details in a structured format. It's efficient with minimal waste, though the 'Returns: pd.DataFrame' could be integrated more smoothly.

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 does a decent job explaining parameters but lacks behavioral context and output details. It's minimally viable for a search tool but misses key operational aspects like error cases or performance hints.

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

Parameters4/5

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

Schema description coverage is 0%, but the description compensates well by explaining both parameters: 'keyword' as 'partial match for fund name to search' and 'output_format' with its enum values and default. This adds meaningful context beyond the bare schema, though it could detail format implications more.

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: 'Search fund by name from stock market' specifies the verb (search), resource (fund), and scope (stock market). However, it doesn't explicitly differentiate from sibling tools like 'list_all_funds' or 'get_fund_asset_holding', which would require a 5.

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?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention sibling tools like 'list_all_funds' for broader listings or other fund-related tools, leaving the agent without context for tool selection.

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