get_all_industries
Retrieve all industry symbols from the Vietnam stock market in JSON or DataFrame format for market analysis and data processing.
Instructions
Get all symbols from stock market
Args:
output_format: Literal['json', 'dataframe'] = 'json'
Returns:
pd.DataFrame or json
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| output_format | No | json |
Implementation Reference
- src/vnstock_mcp/server.py:296-310 (handler)Handler function decorated with @server.tool() for MCP registration. Implements the core logic to fetch all industries using VCIListing.industries_icb() and format output as JSON or pandas DataFrame based on the input parameter.@server.tool() def get_all_industries(output_format: Literal["json", "dataframe"] = "json"): """ Get all symbols from stock market Args: output_format: Literal['json', 'dataframe'] = 'json' Returns: pd.DataFrame or json """ listing = VCIListing() df = listing.industries_icb() if output_format == "json": return df.to_json(orient="records", force_ascii=False) else: return df
- src/vnstock_mcp/server.py:296-296 (registration)The @server.tool() decorator registers get_all_industries as an MCP tool.@server.tool()
- src/vnstock_mcp/server.py:297-297 (schema)Type hints define the input schema: optional output_format parameter with Literal['json', 'dataframe'] defaulting to 'json'. FastMCP infers tool schema from this and docstring.def get_all_industries(output_format: Literal["json", "dataframe"] = "json"):