Skip to main content
Glama
ariesanhthu

VNStock MCP Server

by ariesanhthu

get_all_symbols_by_group

Retrieve all stock symbols from Vietnam's market by group category, returning data in JSON or DataFrame format for analysis.

Instructions

Get all symbols from stock market
Args:
    group: str (group name to get symbols)
    output_format: Literal['json', 'dataframe'] = 'json'
Returns:
    pd.DataFrame

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
groupYes
output_formatNojson

Implementation Reference

  • The handler function for the get_all_symbols_by_group tool. It is registered via the @server.tool() decorator and implements the core logic using VCIListing to fetch symbols by group, supporting JSON or DataFrame output.
    @server.tool()
    def get_all_symbols_by_group(
        group: str, output_format: Literal["json", "dataframe"] = "json"
    ):
        """
        Get all symbols from stock market
        Args:
            group: str (group name to get symbols)
            output_format: Literal['json', 'dataframe'] = 'json'
        Returns:
            pd.DataFrame
        """
        listing = VCIListing()
        df = listing.symbols_by_group(group=group)
        if output_format == "json":
            return df.to_json(orient="records", force_ascii=False)
        else:
            return df
  • The @server.tool() decorator registers the get_all_symbols_by_group function as an MCP tool.
    @server.tool()
  • Type hints and docstring define the input schema (group: str, output_format: Literal) and output (pd.DataFrame or JSON).
        group: str, output_format: Literal["json", "dataframe"] = "json"
    ):
        """
        Get all symbols from stock market
        Args:
            group: str (group name to get symbols)
            output_format: Literal['json', 'dataframe'] = 'json'
        Returns:

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