search_fund
Search for mutual funds in Vietnam's stock market by name using partial keyword matching, returning results in JSON or DataFrame format for analysis.
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
| Name | Required | Description | Default |
|---|---|---|---|
| keyword | Yes | ||
| output_format | No | json |
Implementation Reference
- src/vnstock_mcp/server.py:520-535 (handler)The handler function decorated with @server.tool(), implementing the search_fund tool. It uses FMarketFund to filter funds by keyword and returns the result as JSON or DataFrame.@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
- src/vnstock_mcp/server.py:520-520 (registration)The @server.tool() decorator registers the search_fund function as an MCP tool in the FastMCP server.@server.tool()
- src/vnstock_mcp/server.py:525-526 (schema)Input schema defined by function parameters and type hints: keyword (str), output_format (json or dataframe).keyword: str (partial match for fund name to search) output_format: Literal['json', 'dataframe'] = 'json'