get_all_symbol_groups
Retrieve all stock symbol groups from Vietnam's market to organize and analyze securities by category, supporting JSON or DataFrame output formats.
Instructions
Get all symbol groups from stock market
Args:
output_format: Literal['json', 'dataframe'] = 'json'
Returns:
pd.DataFrame
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| output_format | No | json |
Implementation Reference
- src/vnstock_mcp/server.py:260-293 (handler)The handler function for the 'get_all_symbol_groups' MCP tool. It is registered via the @server.tool() decorator. Returns a hardcoded DataFrame listing all symbol groups (HOSE, HNX, etc.) as JSON or DataFrame based on output_format.@server.tool() def get_all_symbol_groups(output_format: Literal["json", "dataframe"] = "json"): """ Get all symbol groups from stock market Args: output_format: Literal['json', 'dataframe'] = 'json' Returns: pd.DataFrame """ df = pd.DataFrame( [ {"group": "HOSE", "group_name": "All symbols in HOSE"}, {"group": "HNX", "group_name": "All symbols in HNX"}, {"group": "UPCOM", "group_name": "All symbols in UPCOM"}, {"group": "VN30", "group_name": "All symbols in VN30"}, {"group": "VN100", "group_name": "All symbols in VN100"}, {"group": "HNX30", "group_name": "All symbols in HNX30"}, {"group": "VNMidCap", "group_name": "All symbols in VNMidCap"}, {"group": "VNSmallCap", "group_name": "All symbols in VNSmallCap"}, {"group": "VNAllShare", "group_name": "All symbols in VNAllShare"}, {"group": "HNXCon", "group_name": "All symbols in HNXCon"}, {"group": "HNXFin", "group_name": "All symbols in HNXFin"}, {"group": "HNXLCap", "group_name": "All symbols in HNXLCap"}, {"group": "HNXMSCap", "group_name": "All symbols in HNXMSCap"}, {"group": "HNXMan", "group_name": "All symbols in HNXMan"}, {"group": "ETF", "group_name": "All symbols in ETF"}, {"group": "FU_INDEX", "group_name": "All symbols in FU_INDEX"}, {"group": "CW", "group_name": "All symbols in CW"}, ] ) if output_format == "json": return df.to_json(orient="records", force_ascii=False) else: return df
- src/vnstock_mcp/server.py:260-260 (registration)Registration of the get_all_symbol_groups tool using FastMCP's @server.tool() decorator.@server.tool()
- src/vnstock_mcp/server.py:265-266 (schema)Input schema defined in function signature: output_format parameter with Literal type.output_format: Literal['json', 'dataframe'] = 'json' Returns: