Skip to main content
Glama
ariesanhthu

VNStock MCP Server

by ariesanhthu

get_all_symbols_by_industry

Retrieve Vietnam stock market symbols filtered by industry sector. Specify an industry to get relevant symbols or get all symbols across sectors. Output in JSON or DataFrame format.

Instructions

Get all symbols from stock market Args: industry: str = None (if None, return all symbols) output_format: Literal['json', 'dataframe'] = 'json' Returns: pd.DataFrame or json

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
industryNo
output_formatNojson

Implementation Reference

  • The core handler function for the 'get_all_symbols_by_industry' MCP tool. Decorated with @server.tool() for registration and schema inference. Fetches industry-classified symbols using VCIListing.symbols_by_industries(), applies optional industry filter across ICB code columns, and returns data as JSON or pandas DataFrame.
    @server.tool() def get_all_symbols_by_industry( industry: str = None, output_format: Literal["json", "dataframe"] = "json" ): """ Get all symbols from stock market Args: industry: str = None (if None, return all symbols) output_format: Literal['json', 'dataframe'] = 'json' Returns: pd.DataFrame or json """ listing = VCIListing() df = listing.symbols_by_industries() if industry: codes = ["icb_code1", "icb_code2", "icb_code3", "icb_code4"] masks = [] for col in codes: if col in df.columns: masks.append(df[col].astype(str) == industry) if masks: mask = masks[0] for m in masks[1:]: mask = mask | m df = df[mask] if output_format == "json": return df.to_json(orient="records", force_ascii=False) else: return df

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