list_all_funds
Retrieve comprehensive lists of mutual funds from Vietnam's stock market, filterable by fund type (balanced, bond, or stock) and available in JSON or dataframe formats.
Instructions
List all funds from stock market
Args:
fund_type: Literal['BALANCED', 'BOND', 'STOCK', None ] = None (if None, return funds in all types)
output_format: Literal['json', 'dataframe'] = 'json'
Returns:
pd.DataFrame
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fund_type | No | ||
| output_format | No | json |
Implementation Reference
- src/vnstock_mcp/server.py:499-517 (handler)The core handler function for the 'list_all_funds' MCP tool. Decorated with @server.tool() for automatic registration and schema inference from type hints. Fetches fund listing data using vnstock's FMarketFund.listing() and returns as JSON string or pandas DataFrame.@server.tool() def list_all_funds( fund_type: Literal["BALANCED", "BOND", "STOCK", None] = None, output_format: Literal["json", "dataframe"] = "json", ): # pyright: ignore[reportUndefinedVariable] """ List all funds from stock market Args: fund_type: Literal['BALANCED', 'BOND', 'STOCK', None ] = None (if None, return funds in all types) output_format: Literal['json', 'dataframe'] = 'json' Returns: pd.DataFrame """ fund = FMarketFund() df = fund.listing(fund_type=fund_type) if output_format == "json": return df.to_json(orient="records", force_ascii=False) else: return df
- src/vnstock_mcp/server.py:499-499 (registration)MCP tool registration decorator applied to the list_all_funds function, integrating it into the FastMCP server.@server.tool()
- src/vnstock_mcp/server.py:501-502 (schema)Input schema defined by type annotations (Literals for fund_type and output_format) and docstring, used by MCP for validation.fund_type: Literal["BALANCED", "BOND", "STOCK", None] = None, output_format: Literal["json", "dataframe"] = "json",